Ran the codebase through rustfmt

This commit is contained in:
2026-02-23 23:32:46 -05:00
parent fa49e2ef70
commit cf46303659
27 changed files with 254 additions and 240 deletions

View File

@@ -34,8 +34,7 @@ use crate::prelude::*;
pub(crate) static mut SAVED_TERMIOS: Option<Option<Termios>> = None;
pub static TTY_FILENO: LazyLock<RawFd> = LazyLock::new(|| {
open("/dev/tty", OFlag::O_RDWR, Mode::empty())
.expect("Failed to open /dev/tty")
open("/dev/tty", OFlag::O_RDWR, Mode::empty()).expect("Failed to open /dev/tty")
});
#[derive(Debug)]

View File

@@ -15,8 +15,8 @@ impl<T: Display> Styled for T {}
pub enum Style {
// Undoes all styles
Reset,
ResetFg,
ResetBg,
ResetFg,
ResetBg,
// Foreground Colors
Black,
Red,
@@ -68,8 +68,8 @@ impl Display for Style {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Style::Reset => write!(f, "\x1b[0m"),
Style::ResetFg => write!(f, "\x1b[39m"),
Style::ResetBg => write!(f, "\x1b[49m"),
Style::ResetFg => write!(f, "\x1b[39m"),
Style::ResetBg => write!(f, "\x1b[49m"),
// Foreground colors
Style::Black => write!(f, "\x1b[30m"),
@@ -131,13 +131,13 @@ impl StyleSet {
Self { styles: vec![] }
}
pub fn styles(&self) -> &[Style] {
&self.styles
}
pub fn styles(&self) -> &[Style] {
&self.styles
}
pub fn styles_mut(&mut self) -> &mut Vec<Style> {
&mut self.styles
}
pub fn styles_mut(&mut self) -> &mut Vec<Style> {
&mut self.styles
}
pub fn add_style(mut self, style: Style) -> Self {
if !self.styles.contains(&style) {