mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-09 09:49:10 +02:00
CI: Run clippy with Rust 1.46 (#132)
This commit is contained in:
parent
5a2d054ace
commit
e507343f5d
5 changed files with 12 additions and 8 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 = ...)]
|
||||
/// <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 = ...)]`
|
||||
const fn default_auto_update_interval_hours() -> u64 {
|
||||
DEFAULT_UPDATE_INTERVAL_HOURS
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Vec<String>>,
|
||||
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);
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue