fix option_vec_printer
This commit is contained in:
parent
8cbc63fbc7
commit
862efa2c0e
@ -233,7 +233,7 @@ fn newtons_method(
|
|||||||
/// representation of the Vector
|
/// representation of the Vector
|
||||||
pub fn option_vec_printer<T: ToString>(data: Vec<Option<T>>) -> String {
|
pub fn option_vec_printer<T: ToString>(data: Vec<Option<T>>) -> String {
|
||||||
let none_representation = "None";
|
let none_representation = "None";
|
||||||
let max_i = data.len() - 1;
|
let max_i: i32 = (data.len() as i32) - 1;
|
||||||
let output: String = data
|
let output: String = data
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
@ -244,7 +244,7 @@ pub fn option_vec_printer<T: ToString>(data: Vec<Option<T>>) -> String {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Add comma and space if needed
|
// Add comma and space if needed
|
||||||
if max_i > i {
|
if max_i > i as i32 {
|
||||||
tmp += ", ";
|
tmp += ", ";
|
||||||
}
|
}
|
||||||
tmp
|
tmp
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user