Skip to content

Commit

Permalink
refactor: remove unnecessary bool return from static setter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dxrcy committed Dec 26, 2024
1 parent 40b5374 commit ece4759
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ impl Output {
/// Set whether output will be printed 'minimally'.
///
/// Use this method to handle `--minimal` argument.
// TODO(refactor): Return `()`
pub fn set_minimal(new_value: bool) -> bool {
Self::IS_MINIMAL.with(|value| value.replace(new_value))
pub fn set_minimal(new_value: bool) {
Self::IS_MINIMAL.with(|value| value.replace(new_value));
}

/// If cursor is NOT at the start of a line, then start a new line (ie. print '\n').
Expand Down Expand Up @@ -414,9 +413,8 @@ impl LineTracker {
pub fn is_line_start() -> bool {
Self::IS_LINE_START.with(|value| *value.borrow())
}
// TODO(refactor): Return `()`
fn set_line_start(new_value: bool) -> bool {
Self::IS_LINE_START.with(|value| value.replace(new_value))
fn set_line_start(new_value: bool) {
Self::IS_LINE_START.with(|value| value.replace(new_value));
}
}
impl fmt::Write for LineTracker {
Expand All @@ -435,7 +433,7 @@ impl fmt::Write for LineTracker {
'\x00'..='\x1f' | '\x7f' => continue,
// Any other characters are printable
_ => Self::set_line_start(false),
};
}
}
Ok(())
}
Expand Down

0 comments on commit ece4759

Please sign in to comment.