diff --git a/src/misc.rs b/src/misc.rs index 96ef8eb..8dc9185 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -242,8 +242,11 @@ fn newtons_method( /// Inputs `Vec>` and outputs a `String` containing a pretty /// representation of the Vector -pub fn option_vec_printer(data: Vec>) -> String { - let none_representation = "None"; +pub fn option_vec_printer(data: Vec>) -> String +where + T: ToString, + T: Clone, +{ let max_i: i32 = (data.len() as i32) - 1; let output: String = data .iter() @@ -251,7 +254,7 @@ pub fn option_vec_printer(data: Vec>) -> String { .map(|(i, x)| { let mut tmp = match x { Some(inner) => inner.to_string(), - _ => none_representation.to_string(), + _ => "None".to_string(), }; // Add comma and space if needed