cargo fmt --all
This commit is contained in:
parent
fbda31d980
commit
900b73b21a
|
@ -348,13 +348,11 @@ fn expect_data_constr(term: &Constant, index: usize) -> Result<Vec<Constant>, Er
|
|||
|
||||
Err(mismatch(
|
||||
term,
|
||||
Schema::Data(Data::AnyOf(vec![
|
||||
Constructor {
|
||||
Schema::Data(Data::AnyOf(vec![Constructor {
|
||||
index,
|
||||
fields: vec![],
|
||||
}
|
||||
.into(),
|
||||
])),
|
||||
.into()])),
|
||||
))
|
||||
}
|
||||
|
||||
|
|
|
@ -797,13 +797,11 @@ mod tests {
|
|||
let mut definitions = fixture_definitions();
|
||||
definitions.insert(
|
||||
&schema,
|
||||
Schema::Data(Data::AnyOf(vec![
|
||||
Constructor {
|
||||
Schema::Data(Data::AnyOf(vec![Constructor {
|
||||
index: 0,
|
||||
fields: vec![Declaration::Referenced(Reference::new("Bool")).into()],
|
||||
}
|
||||
.into(),
|
||||
]))
|
||||
.into()]))
|
||||
.into(),
|
||||
);
|
||||
|
||||
|
|
|
@ -10,7 +10,11 @@ pub fn ansi_len(s: &str) -> usize {
|
|||
pub fn len_longest_line(zero: usize, s: &str) -> usize {
|
||||
s.lines().fold(zero, |max, 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 {
|
||||
if styled { apply_style(s) } else { s }
|
||||
if styled {
|
||||
apply_style(s)
|
||||
} else {
|
||||
s
|
||||
}
|
||||
}
|
||||
|
||||
pub fn multiline(max_len: usize, s: String) -> Vec<String> {
|
||||
|
|
|
@ -82,8 +82,8 @@ pub fn exec(
|
|||
}
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub fn filter_traces_parser()
|
||||
-> MapValueParser<PossibleValuesParser, fn(String) -> fn(TraceLevel) -> Tracing> {
|
||||
pub fn filter_traces_parser(
|
||||
) -> MapValueParser<PossibleValuesParser, fn(String) -> fn(TraceLevel) -> Tracing> {
|
||||
PossibleValuesParser::new(["user-defined", "compiler-generated", "all"]).map(
|
||||
|s: String| match s.as_str() {
|
||||
"user-defined" => Tracing::UserDefined,
|
||||
|
|
Loading…
Reference in New Issue