From 442c3b403c21b8390a714bc9696bf0e8522d4c05 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 24 Mar 2022 14:21:42 -0400 Subject: [PATCH] thing --- src/misc.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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