diff --git a/crates/nu-protocol/src/pipeline/byte_stream.rs b/crates/nu-protocol/src/pipeline/byte_stream.rs index a2e6b9fd2a..f9a1769e05 100644 --- a/crates/nu-protocol/src/pipeline/byte_stream.rs +++ b/crates/nu-protocol/src/pipeline/byte_stream.rs @@ -223,7 +223,7 @@ impl ByteStream { pub fn skip(self, span: Span, n: u64) -> Result { if let Some(mut reader) = self.reader() { // Copy the number of skipped bytes into the sink before proceeding - io::copy(&mut (&mut reader).take(n as u64), &mut io::sink()).err_span(span)?; + io::copy(&mut (&mut reader).take(n), &mut io::sink()).err_span(span)?; Ok(ByteStream::read( reader, span, @@ -231,10 +231,10 @@ impl ByteStream { ByteStreamType::Binary, )) } else { - return Err(ShellError::TypeMismatch { + Err(ShellError::TypeMismatch { err_message: "expected readable stream".into(), span, - }); + }) } } @@ -247,10 +247,10 @@ impl ByteStream { ByteStreamType::Binary, )) } else { - return Err(ShellError::TypeMismatch { + Err(ShellError::TypeMismatch { err_message: "expected readable stream".into(), span, - }); + }) } } @@ -284,7 +284,7 @@ impl ByteStream { } None if start < 0 || end < 0 => Err(ShellError::IncorrectValue { msg: - "Negative range values cannot be used with streams that don't specify a length" + "Relative range values cannot be used with streams that don't specify a length" .into(), val_span, call_span,