From 862efa2c0ee8830319ccafd6e45b6804eb12d575 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 24 Mar 2022 11:30:03 -0400 Subject: [PATCH] fix option_vec_printer --- src/misc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc.rs b/src/misc.rs index 920271a..a0eb9c1 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -233,7 +233,7 @@ fn newtons_method( /// representation of the Vector pub fn option_vec_printer(data: Vec>) -> String { let none_representation = "None"; - let max_i = data.len() - 1; + let max_i: i32 = (data.len() as i32) - 1; let output: String = data .iter() .enumerate() @@ -244,7 +244,7 @@ pub fn option_vec_printer(data: Vec>) -> String { }; // Add comma and space if needed - if max_i > i { + if max_i > i as i32 { tmp += ", "; } tmp