cargo fmt --all

This commit is contained in:
KtorZ 2024-03-03 21:05:43 +01:00
parent fbda31d980
commit 900b73b21a
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
4 changed files with 22 additions and 18 deletions

View File

@ -348,13 +348,11 @@ fn expect_data_constr(term: &Constant, index: usize) -> Result<Vec<Constant>, Er
Err(mismatch( Err(mismatch(
term, term,
Schema::Data(Data::AnyOf(vec![ Schema::Data(Data::AnyOf(vec![Constructor {
Constructor {
index, index,
fields: vec![], fields: vec![],
} }
.into(), .into()])),
])),
)) ))
} }

View File

@ -797,13 +797,11 @@ mod tests {
let mut definitions = fixture_definitions(); let mut definitions = fixture_definitions();
definitions.insert( definitions.insert(
&schema, &schema,
Schema::Data(Data::AnyOf(vec![ Schema::Data(Data::AnyOf(vec![Constructor {
Constructor {
index: 0, index: 0,
fields: vec![Declaration::Referenced(Reference::new("Bool")).into()], fields: vec![Declaration::Referenced(Reference::new("Bool")).into()],
} }
.into(), .into()]))
]))
.into(), .into(),
); );

View File

@ -10,7 +10,11 @@ pub fn ansi_len(s: &str) -> usize {
pub fn len_longest_line(zero: usize, s: &str) -> usize { pub fn len_longest_line(zero: usize, s: &str) -> usize {
s.lines().fold(zero, |max, l| { s.lines().fold(zero, |max, l| {
let n = ansi_len(l); let n = ansi_len(l);
if n > max { n } else { max } if n > max {
n
} else {
max
}
}) })
} }
@ -124,7 +128,11 @@ pub fn pad_right(mut text: String, n: usize, delimiter: &str) -> String {
} }
pub fn style_if(styled: bool, s: String, apply_style: fn(String) -> String) -> String { pub fn style_if(styled: bool, s: String, apply_style: fn(String) -> String) -> String {
if styled { apply_style(s) } else { s } if styled {
apply_style(s)
} else {
s
}
} }
pub fn multiline(max_len: usize, s: String) -> Vec<String> { pub fn multiline(max_len: usize, s: String) -> Vec<String> {

View File

@ -82,8 +82,8 @@ pub fn exec(
} }
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
pub fn filter_traces_parser() pub fn filter_traces_parser(
-> MapValueParser<PossibleValuesParser, fn(String) -> fn(TraceLevel) -> Tracing> { ) -> MapValueParser<PossibleValuesParser, fn(String) -> fn(TraceLevel) -> Tracing> {
PossibleValuesParser::new(["user-defined", "compiler-generated", "all"]).map( PossibleValuesParser::new(["user-defined", "compiler-generated", "all"]).map(
|s: String| match s.as_str() { |s: String| match s.as_str() {
"user-defined" => Tracing::UserDefined, "user-defined" => Tracing::UserDefined,