mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 23:05:47 +02:00
Clippy & test fixes
This commit is contained in:
committed by
Simon Curtis
parent
88a785a504
commit
ced3866916
@ -223,7 +223,7 @@ impl ByteStream {
|
||||
pub fn skip(self, span: Span, n: u64) -> Result<Self, ShellError> {
|
||||
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,
|
||||
|
Reference in New Issue
Block a user