Skip to content

Commit

Permalink
Make the issue #124 fixture work on Windows. 🤦‍♀️
Browse files Browse the repository at this point in the history
  • Loading branch information
bodil committed Jul 14, 2020
1 parent 1074663 commit d8d8198
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ord/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2382,6 +2382,7 @@ mod test {
let mut map = OrdMap::new();
let contents = include_str!("test-fixtures/issue_124.txt");
for line in contents.split('\n') {
let line = line.trim();

This comment has been minimized.

Copy link
@mcobzarenco

mcobzarenco Jul 26, 2020

Wouldn't contents.lines() be a better choice instead of split?

This comment has been minimized.

Copy link
@bodil

bodil Jul 27, 2020

Author Owner

It most certainly would.

This comment has been minimized.

Copy link
@mcobzarenco

mcobzarenco Jul 27, 2020

Sorry if this was random - I meant in particular it abstracts away newline format (CRLF vs CR/LF)

if line.starts_with("insert ") {
map.insert(line[7..].parse::<u32>().unwrap(), 0);
} else if line.starts_with("remove ") {
Expand Down

0 comments on commit d8d8198

Please sign in to comment.