diff --git a/benches/threading.rs b/benches/threading.rs index fa8ff74c..b7396c5e 100644 --- a/benches/threading.rs +++ b/benches/threading.rs @@ -56,7 +56,7 @@ pub fn process_multi_threaded_german( // } let stage = GermanStage; - let result = stage.substitute(&item).unwrap(); + let result: String = stage.substitute(&item).unwrap().into(); let mut results = results_clone.lock().unwrap(); info!("Thread {} finished processing line", i); @@ -73,7 +73,7 @@ pub fn process_multi_threaded_german( let mut results = Arc::try_unwrap(results).unwrap().into_inner().unwrap(); results.sort_by_key(|&(index, _)| index); - let results: Vec = results.into_iter().map(|(_, result)| result.0).collect(); + let results: Vec = results.into_iter().map(|(_, result)| result).collect(); destination.write_all(results.join("\n").as_bytes()) } diff --git a/src/stages/german/driver.rs b/src/stages/german/driver.rs index 233ff79f..0cf7e188 100644 --- a/src/stages/german/driver.rs +++ b/src/stages/german/driver.rs @@ -566,8 +566,8 @@ mod tests { word: String ) (|data: &TestProcess| { let input = word.clone(); - let result = GermanStage{}.substitute(&input).unwrap(); - insta::assert_yaml_snapshot!(data.to_string(), result.0); + let result: String = GermanStage{}.substitute(&input).unwrap().into(); + insta::assert_yaml_snapshot!(data.to_string(), result); } ) } diff --git a/src/stages/tooling.rs b/src/stages/tooling.rs index d25fdb23..7537fb44 100644 --- a/src/stages/tooling.rs +++ b/src/stages/tooling.rs @@ -24,10 +24,7 @@ impl std::fmt::Display for StageError { /// [newtype](https://doc.rust-lang.org/rust-by-example/generics/new_types.html), used /// for increased clarity. #[derive(Debug)] -pub struct SubstitutedString( - /// The actual string contents. - pub String, -); +pub struct SubstitutedString(String); /// Convert a [`SubstitutedString`] into a [`String`]. ///