cargo fmt --all
This commit is contained in:
@@ -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 {
|
||||
index,
|
||||
fields: vec![],
|
||||
}
|
||||
.into(),
|
||||
])),
|
||||
Schema::Data(Data::AnyOf(vec![Constructor {
|
||||
index,
|
||||
fields: vec![],
|
||||
}
|
||||
.into()])),
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
@@ -797,13 +797,11 @@ mod tests {
|
||||
let mut definitions = fixture_definitions();
|
||||
definitions.insert(
|
||||
&schema,
|
||||
Schema::Data(Data::AnyOf(vec![
|
||||
Constructor {
|
||||
index: 0,
|
||||
fields: vec![Declaration::Referenced(Reference::new("Bool")).into()],
|
||||
}
|
||||
.into(),
|
||||
]))
|
||||
Schema::Data(Data::AnyOf(vec![Constructor {
|
||||
index: 0,
|
||||
fields: vec![Declaration::Referenced(Reference::new("Bool")).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> {
|
||||
|
||||
Reference in New Issue
Block a user