diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a580ac..54c5075 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.39.0 + toolchain: 1.46.0 components: clippy override: true - uses: actions-rs/clippy-check@v1 diff --git a/src/cache.rs b/src/cache.rs index 2de33bb..bc097e8 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -150,7 +150,10 @@ impl Cache { // Get platform dir let platforms_dir = match Self::get_cache_dir() { Ok(cache_dir) => cache_dir.join("tldr-master").join("pages"), - _ => return None, + Err(e) => { + log::error!("Could not get cache directory: {}", e); + return None; + } }; // Determine platform diff --git a/src/config.rs b/src/config.rs index 51d9b28..1b953f1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -8,7 +8,6 @@ use ansi_term::{Color, Style}; use app_dirs::{get_app_root, AppDataType}; use log::debug; use serde_derive::{Deserialize, Serialize}; -use toml; use crate::error::TealdeerError::{self, ConfigError}; @@ -120,8 +119,9 @@ struct RawDisplayConfig { } /// Serde doesn't support default values yet (tracking issue: -/// https://github.com/serde-rs/serde/issues/368), so we need to wrap DEFAULT_UPDATE_INTERVAL_HOURS -/// in a function to be able to use #[serde(default = ...)] +/// ), so we need to wrap +/// `DEFAULT_UPDATE_INTERVAL_HOURS` in a function to be able to use +/// `#[serde(default = ...)]` const fn default_auto_update_interval_hours() -> u64 { DEFAULT_UPDATE_INTERVAL_HOURS } diff --git a/src/main.rs b/src/main.rs index d4fbf5a..196481a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -89,6 +89,7 @@ const ARCHIVE_URL: &str = "https://github.com/tldr-pages/tldr/archive/master.tar const PAGER_COMMAND: &str = "less -R"; #[derive(Debug, Deserialize)] +#[allow(clippy::struct_excessive_bools)] struct Args { arg_command: Option>, flag_help: bool, @@ -158,11 +159,11 @@ fn check_cache(args: &Args) { )) ); } + Some(_) => {} None => { eprintln!("Cache not found. Please run `tldr --update`."); process::exit(1); } - _ => {} }; } diff --git a/src/types.rs b/src/types.rs index 2c0941e..d7e4548 100644 --- a/src/types.rs +++ b/src/types.rs @@ -55,7 +55,7 @@ impl<'a> From<&'a str> for LineType { .into(), ), Some(' ') => Self::ExampleCode(trimmed.trim_start_matches(char::is_whitespace).into()), - _ => Self::ExampleText(trimmed.into()), + Some(_) => Self::ExampleText(trimmed.into()), } } } @@ -88,7 +88,7 @@ impl LineType { .trim_matches(|chr: char| chr == '`' || chr.is_whitespace()) .into(), ), - _ => Self::Other(trimmed.into()), + Some(_) => Self::Other(trimmed.into()), } } }