From 2cae6fbc508fd2776a17bf126f9b7e9f47858549 Mon Sep 17 00:00:00 2001 From: Bodil Stokke Date: Mon, 27 Jul 2020 10:42:53 +0100 Subject: [PATCH] Use str::lines() instead of splitting and stripping for the #124 repro case. --- src/ord/map.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ord/map.rs b/src/ord/map.rs index f047e4f..46c0962 100644 --- a/src/ord/map.rs +++ b/src/ord/map.rs @@ -2381,8 +2381,7 @@ mod test { fn issue_124() { let mut map = OrdMap::new(); let contents = include_str!("test-fixtures/issue_124.txt"); - for line in contents.split('\n') { - let line = line.trim(); + for line in contents.lines() { if line.starts_with("insert ") { map.insert(line[7..].parse::().unwrap(), 0); } else if line.starts_with("remove ") {