mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 01:51:14 -03:00
builtins: idiomatic error code passing
Remaining code smells: - exec_subshell_internal needs to convert a number to a result Closes #10948
This commit is contained in:
committed by
Johannes Altmanninger
parent
bdb8f7da3a
commit
f4a8368c9e
@@ -668,7 +668,7 @@ pub fn flush_and_check_error(&mut self) -> libc::c_int {
|
||||
match self {
|
||||
OutputStream::Fd(stream) => stream.flush_and_check_error(),
|
||||
OutputStream::Buffered(stream) => stream.flush_and_check_error(),
|
||||
OutputStream::Null | OutputStream::String(_) => STATUS_CMD_OK.unwrap(),
|
||||
OutputStream::Null | OutputStream::String(_) => STATUS_CMD_OK,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,7 +794,6 @@ fn flush_and_check_error(&mut self) -> libc::c_int {
|
||||
} else {
|
||||
STATUS_CMD_OK
|
||||
}
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,7 +838,7 @@ fn append_with_separation(
|
||||
}
|
||||
fn flush_and_check_error(&mut self) -> libc::c_int {
|
||||
if self.buffer.discarded() {
|
||||
return STATUS_READ_TOO_MUCH.unwrap();
|
||||
return STATUS_READ_TOO_MUCH;
|
||||
}
|
||||
0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user