mirror of
https://github.com/o2sh/onefetch
synced 2024-06-30 22:54:20 +00:00
cargo clippy pedantic
This commit is contained in:
parent
0b016731d4
commit
ca1db57fd3
|
@ -173,7 +173,7 @@ impl<'a> Tokens<'a> {
|
|||
}
|
||||
fn leading_spaces(&mut self) -> usize {
|
||||
self.take_while(|token| !token.is_solid())
|
||||
.filter(|token| token.is_space())
|
||||
.filter(Token::is_space)
|
||||
.count()
|
||||
}
|
||||
fn truncate(self, mut start: usize, end: usize) -> impl 'a + Iterator<Item = Token> {
|
||||
|
|
14
src/cli.rs
14
src/cli.rs
|
@ -228,13 +228,13 @@ impl Default for InfoCliOptions {
|
|||
InfoCliOptions {
|
||||
number_of_authors: 3,
|
||||
number_of_languages: 6,
|
||||
exclude: Default::default(),
|
||||
no_bots: Default::default(),
|
||||
exclude: Vec::default(),
|
||||
no_bots: Option::default(),
|
||||
no_merges: Default::default(),
|
||||
email: Default::default(),
|
||||
include_hidden: Default::default(),
|
||||
r#type: vec![LanguageType::Programming, LanguageType::Markup],
|
||||
disabled_fields: Default::default(),
|
||||
disabled_fields: Vec::default(),
|
||||
no_title: Default::default(),
|
||||
}
|
||||
}
|
||||
|
@ -254,9 +254,9 @@ impl Default for TextForamttingCliOptions {
|
|||
impl Default for AsciiCliOptions {
|
||||
fn default() -> Self {
|
||||
AsciiCliOptions {
|
||||
ascii_input: Default::default(),
|
||||
ascii_colors: Default::default(),
|
||||
ascii_language: Default::default(),
|
||||
ascii_input: Option::default(),
|
||||
ascii_colors: Vec::default(),
|
||||
ascii_language: Option::default(),
|
||||
true_color: When::Auto,
|
||||
}
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ impl Default for AsciiCliOptions {
|
|||
impl Default for ImageCliOptions {
|
||||
fn default() -> Self {
|
||||
ImageCliOptions {
|
||||
image: Default::default(),
|
||||
image: Option::default(),
|
||||
image_protocol: Default::default(),
|
||||
color_resolution: 16,
|
||||
}
|
||||
|
|
|
@ -81,12 +81,12 @@ mod test {
|
|||
#[test]
|
||||
fn test_display_head_refs() {
|
||||
let head = HeadRefs::new("be561d5".into(), vec!["main".into(), "origin/main".into()]);
|
||||
assert_eq!(head.to_string(), "be561d5 (main, origin/main)")
|
||||
assert_eq!(head.to_string(), "be561d5 (main, origin/main)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_display_head_refs_with_no_refs() {
|
||||
let head = HeadRefs::new("be561d5".into(), vec![]);
|
||||
assert_eq!(head.to_string(), "be561d5")
|
||||
assert_eq!(head.to_string(), "be561d5");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ mod tests {
|
|||
#[test]
|
||||
fn display_time_as_iso_time_some_time() {
|
||||
// Set "current" time to 11/18/2021 11:02:22
|
||||
let time_sample = 1637233282;
|
||||
let time_sample = 1_637_233_282;
|
||||
let time = Time::new(time_sample, 0);
|
||||
let result = format_time(time, true);
|
||||
assert_eq!(result, "2021-11-18T11:01:22Z");
|
||||
|
|
Loading…
Reference in New Issue
Block a user