Compare commits

..

No commits in common. "088824efdf8c7cb90a3ac3703d894e89081d1303" and "7157c70b1f870b6df928d0472ce7ff0f4e16e216" have entirely different histories.

2 changed files with 8 additions and 7 deletions

View File

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 20222023 Emma Tebibyte * Copyright (c) 2022 Emma Tebibyte
* SPDX-License-Identifier: AGPL-3.0-or-later * SPDX-License-Identifier: AGPL-3.0-or-later
* *
* This program is free software: you can redistribute it and/or modify it under * This program is free software: you can redistribute it and/or modify it under
@ -67,7 +67,8 @@ fn parse_toml(
}; };
match value { match value {
Value::Array(array) => { // TODO: Split Array logic into separate function // TODO: Implement other type parsing
Value::Array(array) => {
let element: String; let element: String;
match index { match index {
Some(i) => { Some(i) => {
@ -77,7 +78,7 @@ fn parse_toml(
Some(val) => val.to_owned(), Some(val) => val.to_owned(),
None => { None => {
return Err(( return Err((
format!("{:?}: No value at given key.", i), format!("{:?}: No value at given key.", index),
EX_DATAERR EX_DATAERR
)); ));
}, },
@ -94,10 +95,10 @@ fn parse_toml(
}; };
out.push_str(&element); out.push_str(&element);
}, },
Value::Boolean(boolean) => out.push_str(&format!("{:?}", boolean)), Value::Boolean(_boolean) => {},
Value::Datetime(datetime) => out.push_str(&format!("{:?}", datetime)), Value::Datetime(_datetime) => {},
Value::Float(float) => out.push_str(&format!("{:?}", float)), Value::Float(_float) => {},
Value::Integer(int) => out.push_str(&format!("{:?}", int)), Value::Integer(_int) => {},
Value::String(string) => out.push_str(string.as_str()), Value::String(string) => out.push_str(string.as_str()),
_ => return Err((format!("{:?}: No such key.", item), EX_DATAERR)), _ => return Err((format!("{:?}: No such key.", item), EX_DATAERR)),
}; };