Ran the codebase through rustfmt
This commit is contained in:
@@ -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)]
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user