diff --git a/src/game.rs b/src/game.rs index 5922761..fa023ab 100644 --- a/src/game.rs +++ b/src/game.rs @@ -125,7 +125,7 @@ impl Game { } let string = string.trim_start_matches('\n').to_string(); - let mut segments = segments_from_string(string); + let mut segments = segments_from_str(&string); let mut name = "".to_string(); diff --git a/src/lib.rs b/src/lib.rs index e8539aa..2b95d01 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -187,7 +187,7 @@ impl Unquote for String { #[cfg(test)] mod test { - use crate::{ToBase36, optional_data_line, mock, segments_from_string, Quote, Unquote, new_unique_id, try_id}; + use crate::{ToBase36, optional_data_line, mock, segments_from_str, Quote, Unquote, new_unique_id, try_id}; #[test] fn to_base36() { @@ -202,9 +202,7 @@ mod test { #[test] fn string_to_segments() { - let output = segments_from_string( - include_str!("./test-resources/segments").to_string() - ); + let output = segments_from_str(include_str!("./test-resources/segments")); let expected = vec![ "\"\"\"\nthe first segment is a long bit of text\n\n\nit contains empty lines\n\n\"\"\"".to_string(),