From aead9dc91eaa51922c8f93daa38d5d18d73e3890 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 26 Aug 2020 00:48:25 +0200 Subject: Remove some more unnecessary 'to_string()' calls (#7190) --- cli/ops/io.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cli/ops/io.rs') diff --git a/cli/ops/io.rs b/cli/ops/io.rs index 6b97f542c..14d32a39b 100644 --- a/cli/ops/io.rs +++ b/cli/ops/io.rs @@ -117,7 +117,7 @@ fn get_stdio_stream( } fn no_buffer_specified() -> ErrBox { - ErrBox::type_error("no buffer specified".to_string()) + ErrBox::type_error("no buffer specified") } #[cfg(unix)] @@ -262,9 +262,9 @@ pub fn op_read( .map(|n: usize| n as i32) .map_err(ErrBox::from) } - Err(_) => Err(ErrBox::type_error( - "sync read not allowed on this resource".to_string(), - )), + Err(_) => { + Err(ErrBox::type_error("sync read not allowed on this resource")) + } }) }) } else { @@ -383,9 +383,9 @@ pub fn op_write( .map(|nwritten: usize| nwritten as i32) .map_err(ErrBox::from) } - Err(_) => Err(ErrBox::type_error( - "sync read not allowed on this resource".to_string(), - )), + Err(_) => { + Err(ErrBox::type_error("sync read not allowed on this resource")) + } }) }) } else { -- cgit v1.2.3