style: 💄 linting

This commit is contained in:
Lucas Colombo 2024-03-31 01:38:13 -03:00
parent 081d16b5c9
commit 72890fcbee
Signed by: lucas
GPG Key ID: EF34786CFEFFAE35
3 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ tasks:
lint: lint:
desc: 🧶 lint lool desc: 🧶 lint lool
cmds: cmds:
- cargo clippy --fix - cargo clippy --fix --all-features
test: test:
desc: 🧪 test lool desc: 🧪 test lool

View File

@ -86,7 +86,7 @@ impl Color {
"bright-magenta" => Some(Color::BrightMagenta), "bright-magenta" => Some(Color::BrightMagenta),
"bright-cyan" => Some(Color::BrightCyan), "bright-cyan" => Some(Color::BrightCyan),
"bright-white" => Some(Color::BrightWhite), "bright-white" => Some(Color::BrightWhite),
s if s.starts_with("#") => { s if s.starts_with('#') => {
let s = &s[1..]; let s = &s[1..];
let r = u8::from_str_radix(&s[0..2], 16).context("Error parsing RGB color")?; let r = u8::from_str_radix(&s[0..2], 16).context("Error parsing RGB color")?;
let g = u8::from_str_radix(&s[2..4], 16).context("Error parsing RGB color")?; let g = u8::from_str_radix(&s[2..4], 16).context("Error parsing RGB color")?;

View File

@ -29,7 +29,7 @@ pub mod instructions {
pub fn parse(instructions: &str) -> Result<StyledString> { pub fn parse(instructions: &str) -> Result<StyledString> {
let mut styled_string = StyledString::default(); let mut styled_string = StyledString::default();
if instructions.starts_with("+") { if instructions.starts_with('+') {
// only attributes // only attributes
styled_string.attrs = attributes_from_str(instructions.trim_start_matches('+')) styled_string.attrs = attributes_from_str(instructions.trim_start_matches('+'))
.map_err(|e| eyre::eyre!(e))?; .map_err(|e| eyre::eyre!(e))?;