diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-11-07 18:24:41 +0100 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-11-07 18:24:41 +0100 |
| commit | 96dd8d67b3b2a77c5b33b8c2d8ebbcfe99e0791b (patch) | |
| tree | 57356d669911c2f49dbacfd17d37697a3544d527 /crates | |
| parent | fix(libmpv2/libmpv2-sys/build.rs): Add the libmpv2 searchpath to flags (diff) | |
| download | yt-96dd8d67b3b2a77c5b33b8c2d8ebbcfe99e0791b.zip | |
refactor({yt/cmds/{download,select},colors/custom}): Remove clippy warnings
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/colors/src/custom.rs | 5 | ||||
| -rw-r--r-- | crates/yt/src/commands/download/mod.rs | 10 | ||||
| -rw-r--r-- | crates/yt/src/commands/select/mod.rs | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/crates/colors/src/custom.rs b/crates/colors/src/custom.rs index fd6b7b3..47283ec 100644 --- a/crates/colors/src/custom.rs +++ b/crates/colors/src/custom.rs @@ -13,6 +13,10 @@ const U8_TO_STR: [[u8; 3]; 256] = generate_lookup(); +#[expect( + clippy::cast_possible_truncation, + reason = "We deal only with < 256 numbers, they fit." +)] const fn generate_lookup() -> [[u8; 3]; 256] { let mut table = [[0, 0, 0]; 256]; @@ -32,6 +36,7 @@ const fn generate_lookup() -> [[u8; 3]; 256] { #[derive(Clone, Copy)] pub(crate) enum Plane { Fg, + #[expect(unused)] Bg, } diff --git a/crates/yt/src/commands/download/mod.rs b/crates/yt/src/commands/download/mod.rs index 148aebb..d025f37 100644 --- a/crates/yt/src/commands/download/mod.rs +++ b/crates/yt/src/commands/download/mod.rs @@ -8,11 +8,8 @@ // You should have received a copy of the License along with this program. // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -use anyhow::Context; use clap::Parser; -use crate::shared::bytes::Bytes; - mod implm; #[derive(Parser, Debug)] @@ -27,10 +24,3 @@ pub(super) struct DownloadCommand { #[arg(short, long, default_value_t = usize::MAX)] count: usize, } - -fn byte_parser(input: &str) -> Result<u64, anyhow::Error> { - Ok(input - .parse::<Bytes>() - .with_context(|| format!("Failed to parse '{input}' as bytes!"))? - .as_u64()) -} diff --git a/crates/yt/src/commands/select/mod.rs b/crates/yt/src/commands/select/mod.rs index 085c244..ab8e6b0 100644 --- a/crates/yt/src/commands/select/mod.rs +++ b/crates/yt/src/commands/select/mod.rs @@ -171,6 +171,7 @@ impl SelectCommand { #[derive(Clone, Debug, Copy)] struct OptionalNaiveDate { + #[expect(unused)] date: Option<NaiveDate>, } impl FromStr for OptionalNaiveDate { @@ -187,6 +188,7 @@ impl FromStr for OptionalNaiveDate { } #[derive(Clone, Debug)] struct OptionalPublisher { + #[expect(unused)] publisher: Option<String>, } impl FromStr for OptionalPublisher { |
