From 1fd91eec1e80a43d832ff2e11c8b830b7cc5e37c Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Fri, 1 Mar 2024 21:18:03 -0800 Subject: [PATCH] Nightly clippy fixes There are a few additionaly warnings because of https://github.com/rust-lang/rust-clippy/issues/12377, which is a nightly-only bug that will hopefully be fixed. --- cli/src/cli_util.rs | 1 - cli/src/merge_tools/builtin.rs | 1 - lib/src/backend.rs | 2 -- lib/src/content_hash.rs | 2 -- lib/src/default_index/revset_engine.rs | 1 - lib/src/git_backend.rs | 1 - lib/src/id_prefix.rs | 1 - lib/src/local_backend.rs | 1 - lib/src/simple_op_store.rs | 4 ---- lib/src/ssh_signing.rs | 2 +- 10 files changed, 1 insertion(+), 15 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 13166011f0..e96b40cc94 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -73,7 +73,6 @@ use jj_lib::workspace::{ use jj_lib::{dag_walk, file_util, git, op_walk, revset}; use once_cell::unsync::OnceCell; use thiserror::Error; -use toml_edit; use tracing::instrument; use tracing_chrome::ChromeLayerBuilder; use tracing_subscriber::prelude::*; diff --git a/cli/src/merge_tools/builtin.rs b/cli/src/merge_tools/builtin.rs index 331d0b5a2f..2c98abce16 100644 --- a/cli/src/merge_tools/builtin.rs +++ b/cli/src/merge_tools/builtin.rs @@ -558,7 +558,6 @@ mod tests { use jj_lib::conflicts::extract_as_single_hunk; use jj_lib::merge::MergedTreeValue; use jj_lib::repo::Repo; - use pollster::FutureExt; use testutils::TestRepo; use super::*; diff --git a/lib/src/backend.rs b/lib/src/backend.rs index d4fbf31dae..ea756a7986 100644 --- a/lib/src/backend.rs +++ b/lib/src/backend.rs @@ -18,9 +18,7 @@ use std::any::Any; use std::collections::BTreeMap; use std::fmt::Debug; use std::io::Read; -use std::result::Result; use std::time::SystemTime; -use std::vec::Vec; use async_trait::async_trait; use thiserror::Error; diff --git a/lib/src/content_hash.rs b/lib/src/content_hash.rs index 4064917dc1..4738697680 100644 --- a/lib/src/content_hash.rs +++ b/lib/src/content_hash.rs @@ -149,8 +149,6 @@ where mod tests { use std::collections::{BTreeMap, HashMap}; - use blake2::Blake2b512; - use super::*; #[test] diff --git a/lib/src/default_index/revset_engine.rs b/lib/src/default_index/revset_engine.rs index b2778c5e11..d277516c58 100644 --- a/lib/src/default_index/revset_engine.rs +++ b/lib/src/default_index/revset_engine.rs @@ -1090,7 +1090,6 @@ fn has_diff_from_parent( #[cfg(test)] mod tests { use super::*; - use crate::backend::{ChangeId, CommitId}; use crate::default_index::DefaultMutableIndex; /// Generator of unique 16-byte ChangeId excluding root id diff --git a/lib/src/git_backend.rs b/lib/src/git_backend.rs index 407070d6d5..2c00ad6eeb 100644 --- a/lib/src/git_backend.rs +++ b/lib/src/git_backend.rs @@ -1295,7 +1295,6 @@ mod tests { use test_case::test_case; use super::*; - use crate::backend::{FileId, MillisSinceEpoch}; use crate::content_hash::blake2b_hash; #[test_case(false; "legacy tree format")] diff --git a/lib/src/id_prefix.rs b/lib/src/id_prefix.rs index e0fe7daa17..e410436984 100644 --- a/lib/src/id_prefix.rs +++ b/lib/src/id_prefix.rs @@ -445,7 +445,6 @@ fn unwrap_as_short_key(key_bytes: &[u8]) -> &[u8; N] { #[cfg(test)] mod tests { use super::*; - use crate::backend::ChangeId; #[derive(Clone, Copy, Eq, PartialEq)] struct Position(usize); diff --git a/lib/src/local_backend.rs b/lib/src/local_backend.rs index 52555d45f1..30130f8467 100644 --- a/lib/src/local_backend.rs +++ b/lib/src/local_backend.rs @@ -496,7 +496,6 @@ mod tests { use pollster::FutureExt; use super::*; - use crate::backend::MillisSinceEpoch; /// Test that parents get written correctly #[test] diff --git a/lib/src/simple_op_store.rs b/lib/src/simple_op_store.rs index 75588e2827..1b43841c5d 100644 --- a/lib/src/simple_op_store.rs +++ b/lib/src/simple_op_store.rs @@ -685,10 +685,6 @@ mod tests { use maplit::{btreemap, hashmap, hashset}; use super::*; - use crate::backend::{CommitId, MillisSinceEpoch, Timestamp}; - use crate::content_hash::blake2b_hash; - use crate::object_id::ObjectId; - use crate::op_store::{OperationMetadata, RefTarget, WorkspaceId}; fn create_view() -> View { let new_remote_ref = |target: &RefTarget| RemoteRef { diff --git a/lib/src/ssh_signing.rs b/lib/src/ssh_signing.rs index f1cca0e0b3..235d565365 100644 --- a/lib/src/ssh_signing.rs +++ b/lib/src/ssh_signing.rs @@ -269,7 +269,7 @@ impl SigningBackend for SshBackend { #[cfg(test)] mod tests { use std::fs::File; - use std::io::{Read, Write}; + use std::io::Read; use super::*;