add comments
This commit is contained in:
parent
781aced325
commit
d37adbecc5
@ -180,13 +180,18 @@ pub fn newtons_method(
|
|||||||
output_list
|
output_list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Parses a json array of strings into a single, multiline string
|
||||||
pub fn parse_value(value: &serde_json::Value) -> String {
|
pub fn parse_value(value: &serde_json::Value) -> String {
|
||||||
|
// Create vector of strings
|
||||||
let string_vector: Vec<&str> = value
|
let string_vector: Vec<&str> = value
|
||||||
.as_array()
|
.as_array()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.iter()
|
.iter()
|
||||||
.map(|ele| ele.as_str().unwrap())
|
.map(|ele| ele.as_str().unwrap())
|
||||||
.collect::<Vec<&str>>();
|
.collect::<Vec<&str>>();
|
||||||
|
|
||||||
|
|
||||||
|
// Deliminate vector with a new line and return the resulting multiline string
|
||||||
string_vector
|
string_vector
|
||||||
.iter()
|
.iter()
|
||||||
.fold(String::new(), |s, l| s + l + "\n")
|
.fold(String::new(), |s, l| s + l + "\n")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user