From 2a6b87cf023ba81e928ac23015f728db399e1860 Mon Sep 17 00:00:00 2001 From: Artem Varaksa Date: Mon, 11 Mar 2024 23:23:23 +0300 Subject: [PATCH] Address warnings and clippy in new Rust version. --- src/github/mod.rs | 4 ++-- src/localization/changes.rs | 4 ++-- src/markdown/commit.rs | 2 +- src/markdown/post.rs | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/github/mod.rs b/src/github/mod.rs index 6a6f89b..51dec1d 100644 --- a/src/github/mod.rs +++ b/src/github/mod.rs @@ -106,7 +106,7 @@ pub async fn get_commit(platform: Platform, sha: &str) -> anyhow::Result files: Some(Vec::new()), }, |target, source| { - target.sha = source.sha.clone(); + target.sha.clone_from(&source.sha); target.commit = source.commit.clone(); if let Some(part_files) = &mut source.files { target.files.as_mut().unwrap().append(part_files); @@ -185,7 +185,7 @@ where match link_header.get("next") { Some(link) => { - url_string = link.raw_uri.clone(); + url_string.clone_from(&link.raw_uri); page += 1; } None => { diff --git a/src/localization/changes.rs b/src/localization/changes.rs index c783733..4ca1297 100644 --- a/src/localization/changes.rs +++ b/src/localization/changes.rs @@ -115,8 +115,8 @@ mod tests { use super::*; use crate::{ - localization::{LocalizationChange, LocalizationChanges, StringsFileKind::*}, - platform::Platform::{self, *}, + localization::{LocalizationChange, StringsFileKind::*}, + platform::Platform::*, }; #[test_case(Android, "v1.2.3", "v1.2.4", Complete, vec![ diff --git a/src/markdown/commit.rs b/src/markdown/commit.rs index 95ca798..1dd5d39 100644 --- a/src/markdown/commit.rs +++ b/src/markdown/commit.rs @@ -129,7 +129,7 @@ mod tests { use test_case::test_case; use super::*; - use crate::platform::Platform::{self, *}; + use crate::platform::Platform::*; #[test_case(true, "Updated language translations.")] #[test_case(true, "Update strings")] diff --git a/src/markdown/post.rs b/src/markdown/post.rs index 628a139..ecdaba1 100644 --- a/src/markdown/post.rs +++ b/src/markdown/post.rs @@ -258,16 +258,15 @@ Gathered from [{provider}]({comparison_url}) } #[cfg(test)] +#[allow(clippy::too_many_arguments)] mod tests { - #![allow(clippy::too_many_arguments)] - use pretty_assertions::assert_str_eq; use test_case::test_case; use super::*; use crate::{ localization::{Completeness, LocalizationChange, LocalizationChanges, StringsFileKind::*}, - platform::Platform::{self, *}, + platform::Platform::*, }; #[test_case(Android, "v1.2.3", "v1.2.4", None, vec![