mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 20:38:44 +00:00
Handle todos
This commit is contained in:
parent
d929becefc
commit
906e774372
@ -98,7 +98,9 @@ impl<'b> Controller<'b> {
|
|||||||
};
|
};
|
||||||
if let Err(error) = result {
|
if let Err(error) = result {
|
||||||
match writer {
|
match writer {
|
||||||
OutputHandle::FmtWrite(writer) => todo!(),
|
// It doesn't make much sense to send errors straight to stderr if the user
|
||||||
|
// provided their own buffer, so we just return it.
|
||||||
|
OutputHandle::FmtWrite(_) => return Err(error),
|
||||||
OutputHandle::IoWrite(ref mut writer) => {
|
OutputHandle::IoWrite(ref mut writer) => {
|
||||||
if attached_to_pager {
|
if attached_to_pager {
|
||||||
handle_error(&error, writer);
|
handle_error(&error, writer);
|
||||||
|
@ -134,7 +134,16 @@ impl<'a> Printer for SimplePrinter<'a> {
|
|||||||
} else {
|
} else {
|
||||||
match handle {
|
match handle {
|
||||||
OutputHandle::IoWrite(handle) => handle.write_all(line_buffer)?,
|
OutputHandle::IoWrite(handle) => handle.write_all(line_buffer)?,
|
||||||
OutputHandle::FmtWrite(handle) => todo!(),
|
OutputHandle::FmtWrite(handle) => {
|
||||||
|
write!(
|
||||||
|
handle,
|
||||||
|
"{}",
|
||||||
|
std::str::from_utf8(line_buffer).map_err(|_| Error::Msg(
|
||||||
|
"encountered invalid utf8 while printing to non-io buffer"
|
||||||
|
.to_string()
|
||||||
|
))?
|
||||||
|
)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user