fmt: always forget about fmt

This commit is contained in:
Yiffy Dev 2024-11-02 00:34:03 +05:00 • committed by spushk
commit f4827a4902
Signed by: spushk
GPG key ID: 7797B761E105E8AA
2 changed files with 11 additions and 13 deletions

View file

@ -109,19 +109,22 @@ impl Debug for SabryCompilerError {
Self::LightPrint(e) => format!(
"{} at {:?}",
e.kind,
e.loc.clone()
e.loc
.clone()
.map(|l| format!("file {}, line {}, col {}", l.filename, l.line, l.column))
),
Self::GrassCompile(err) => format!("{err}"),
Self::LightMinify(e) => format!(
"{} at {:?}",
e.kind,
e.loc.clone()
e.loc
.clone()
.map(|l| format!("file {}, line {}, col {}", l.filename, l.line, l.column))
),
Self::LightParse { kind, loc } => format!(
"{kind} at {:?}",
loc.clone().map(|l| format!("file {}, line {}, col {}", l.filename, l.line, l.column))
loc.clone()
.map(|l| format!("file {}, line {}, col {}", l.filename, l.line, l.column))
),
};

View file

@ -18,7 +18,7 @@ pub enum ScopeError {
impl Debug for ScopeError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let a = match self {
Self::Raffia(kind, source) => format!("{kind}: at {source}")
Self::Raffia(kind, source) => format!("{kind}: at {source}"),
};
write!(f, "{a}")
@ -43,14 +43,11 @@ impl<'s> ArbitraryScope<'s> {
Ok(a) => a,
Err(e) => {
let source = &source[e.span.start..e.span.end];
return Err(ScopeError::Raffia(e.kind, source.to_string()))
return Err(ScopeError::Raffia(e.kind, source.to_string()));
}
};
Ok(Self {
adapter,
name,
})
Ok(Self { adapter, name })
}
/// Consume arbitrary scope and create a [HashedScope] in its basis