diff --git a/Cargo.toml b/Cargo.toml index d21fc1730..574b00437 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -139,6 +139,7 @@ implicit_clone = "warn" needless_for_each = "warn" semicolon_if_nothing_returned = "warn" uninlined_format_args = "warn" +unused_trait_names = "warn" useless_conversion = "warn" # Insta suggests compiling these packages in opt mode for faster testing. diff --git a/cli/examples/custom-commit-templater/main.rs b/cli/examples/custom-commit-templater/main.rs index 72e21baa7..12e7e5647 100644 --- a/cli/examples/custom-commit-templater/main.rs +++ b/cli/examples/custom-commit-templater/main.rs @@ -15,19 +15,19 @@ use std::any::Any; use std::rc::Rc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_cli::cli_util::CliRunner; use jj_cli::commit_templater::CommitTemplateBuildFnTable; use jj_cli::commit_templater::CommitTemplateLanguage; use jj_cli::commit_templater::CommitTemplateLanguageExtension; -use jj_cli::template_builder::TemplateLanguage; +use jj_cli::template_builder::TemplateLanguage as _; use jj_cli::template_parser; use jj_cli::template_parser::TemplateParseError; use jj_cli::templater::TemplatePropertyExt as _; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; use jj_lib::extensions_map::ExtensionsMap; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::repo::Repo; use jj_lib::revset::FunctionCallNode; use jj_lib::revset::PartialSymbolResolver; diff --git a/cli/examples/custom-operation-templater/main.rs b/cli/examples/custom-operation-templater/main.rs index bfd7b0a97..ac57ee612 100644 --- a/cli/examples/custom-operation-templater/main.rs +++ b/cli/examples/custom-operation-templater/main.rs @@ -16,12 +16,12 @@ use jj_cli::cli_util::CliRunner; use jj_cli::operation_templater::OperationTemplateBuildFnTable; use jj_cli::operation_templater::OperationTemplateLanguage; use jj_cli::operation_templater::OperationTemplateLanguageExtension; -use jj_cli::template_builder::TemplateLanguage; +use jj_cli::template_builder::TemplateLanguage as _; use jj_cli::template_parser; use jj_cli::template_parser::TemplateParseError; use jj_cli::templater::TemplatePropertyExt as _; use jj_lib::extensions_map::ExtensionsMap; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_store::OperationId; use jj_lib::operation::Operation; diff --git a/cli/examples/custom-working-copy/main.rs b/cli/examples/custom-working-copy/main.rs index 706c1e975..5d73db111 100644 --- a/cli/examples/custom-working-copy/main.rs +++ b/cli/examples/custom-working-copy/main.rs @@ -17,7 +17,7 @@ use std::path::Path; use std::path::PathBuf; use std::sync::Arc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_cli::cli_util::CliRunner; use jj_cli::cli_util::CommandHelper; use jj_cli::command_error::CommandError; diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index bfc09744b..196739163 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -33,23 +33,23 @@ use std::sync::Arc; use std::time::SystemTime; use bstr::ByteVec as _; -use chrono::TimeZone; +use chrono::TimeZone as _; use clap::builder::MapValueParser; use clap::builder::NonEmptyStringValueParser; -use clap::builder::TypedValueParser; +use clap::builder::TypedValueParser as _; use clap::builder::ValueParserFactory; use clap::error::ContextKind; use clap::error::ContextValue; use clap::ArgAction; use clap::ArgMatches; use clap::Command; -use clap::FromArgMatches; +use clap::FromArgMatches as _; use clap_complete::ArgValueCandidates; use clap_complete::ArgValueCompleter; use indexmap::IndexMap; use indexmap::IndexSet; use indoc::writedoc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::BackendResult; use jj_lib::backend::ChangeId; use jj_lib::backend::CommitId; @@ -73,7 +73,7 @@ use jj_lib::id_prefix::IdPrefixContext; use jj_lib::matchers::Matcher; use jj_lib::merge::MergedTreeValue; use jj_lib::merged_tree::MergedTree; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_heads_store; use jj_lib::op_store::OpStoreError; use jj_lib::op_store::OperationId; @@ -103,7 +103,7 @@ use jj_lib::revset::RevsetExpression; use jj_lib::revset::RevsetExtensions; use jj_lib::revset::RevsetFilterPredicate; use jj_lib::revset::RevsetFunction; -use jj_lib::revset::RevsetIteratorExt; +use jj_lib::revset::RevsetIteratorExt as _; use jj_lib::revset::RevsetModifier; use jj_lib::revset::RevsetParseContext; use jj_lib::revset::RevsetWorkspaceContext; diff --git a/cli/src/commands/abandon.rs b/cli/src/commands/abandon.rs index 6f23d01e4..b8109d73f 100644 --- a/cli/src/commands/abandon.rs +++ b/cli/src/commands/abandon.rs @@ -13,13 +13,13 @@ // limitations under the License. use std::collections::HashSet; -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCandidates; use itertools::Itertools as _; use jj_lib::backend::CommitId; -use jj_lib::commit::CommitIteratorExt; -use jj_lib::object_id::ObjectId; +use jj_lib::commit::CommitIteratorExt as _; +use jj_lib::object_id::ObjectId as _; use jj_lib::refs::diff_named_ref_targets; use jj_lib::repo::Repo as _; use jj_lib::rewrite::RewriteRefsOptions; diff --git a/cli/src/commands/backout.rs b/cli/src/commands/backout.rs index 230866ffc..b0bca706a 100644 --- a/cli/src/commands/backout.rs +++ b/cli/src/commands/backout.rs @@ -15,7 +15,7 @@ use bstr::ByteVec as _; use clap_complete::ArgValueCandidates; use itertools::Itertools as _; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::rewrite::merge_commit_trees; use tracing::instrument; diff --git a/cli/src/commands/bookmark/list.rs b/cli/src/commands/bookmark/list.rs index b0f4bda74..8204597d2 100644 --- a/cli/src/commands/bookmark/list.rs +++ b/cli/src/commands/bookmark/list.rs @@ -16,8 +16,8 @@ use std::collections::HashSet; use std::rc::Rc; use clap_complete::ArgValueCandidates; -use itertools::Itertools; -use jj_lib::repo::Repo; +use itertools::Itertools as _; +use jj_lib::repo::Repo as _; use jj_lib::revset::RevsetExpression; use jj_lib::str_util::StringPattern; diff --git a/cli/src/commands/commit.rs b/cli/src/commands/commit.rs index dfdfe26c5..d533b29bf 100644 --- a/cli/src/commands/commit.rs +++ b/cli/src/commands/commit.rs @@ -14,8 +14,8 @@ use clap_complete::ArgValueCompleter; use jj_lib::backend::Signature; -use jj_lib::object_id::ObjectId; -use jj_lib::repo::Repo; +use jj_lib::object_id::ObjectId as _; +use jj_lib::repo::Repo as _; use tracing::instrument; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/config/set.rs b/cli/src/commands/config/set.rs index 7497f3269..9dbbb8c8c 100644 --- a/cli/src/commands/config/set.rs +++ b/cli/src/commands/config/set.rs @@ -18,7 +18,7 @@ use clap_complete::ArgValueCandidates; use jj_lib::commit::Commit; use jj_lib::config::ConfigNamePathBuf; use jj_lib::config::ConfigValue; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use tracing::instrument; use super::ConfigLevelArgs; diff --git a/cli/src/commands/debug/copy_detection.rs b/cli/src/commands/debug/copy_detection.rs index 8aa6b72e0..910dbb496 100644 --- a/cli/src/commands/debug/copy_detection.rs +++ b/cli/src/commands/debug/copy_detection.rs @@ -17,7 +17,7 @@ use std::io::Write as _; use futures::executor::block_on_stream; use jj_lib::backend::CopyRecord; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use crate::cli_util::CommandHelper; use crate::cli_util::RevisionArg; diff --git a/cli/src/commands/debug/init_local.rs b/cli/src/commands/debug/init_local.rs index 5fef64077..9d72d55cf 100644 --- a/cli/src/commands/debug/init_local.rs +++ b/cli/src/commands/debug/init_local.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use jj_lib::file_util; use jj_lib::workspace::Workspace; diff --git a/cli/src/commands/debug/local_working_copy.rs b/cli/src/commands/debug/local_working_copy.rs index eee9a8de5..d922cd73c 100644 --- a/cli/src/commands/debug/local_working_copy.rs +++ b/cli/src/commands/debug/local_working_copy.rs @@ -15,7 +15,7 @@ use std::fmt::Debug; use std::io::Write as _; -use jj_lib::working_copy::WorkingCopy; +use jj_lib::working_copy::WorkingCopy as _; use super::check_local_disk_wc; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/debug/operation.rs b/cli/src/commands/debug/operation.rs index 53c4a6258..d6bd86198 100644 --- a/cli/src/commands/debug/operation.rs +++ b/cli/src/commands/debug/operation.rs @@ -16,7 +16,7 @@ use std::fmt::Debug; use std::io::Write as _; use clap_complete::ArgValueCandidates; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_walk; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/debug/revset.rs b/cli/src/commands/debug/revset.rs index 3f1494022..0c90df675 100644 --- a/cli/src/commands/debug/revset.rs +++ b/cli/src/commands/debug/revset.rs @@ -15,7 +15,7 @@ use std::fmt::Debug; use std::io::Write as _; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::revset; use jj_lib::revset::RevsetDiagnostics; diff --git a/cli/src/commands/debug/tree.rs b/cli/src/commands/debug/tree.rs index 70010dec2..5f400215b 100644 --- a/cli/src/commands/debug/tree.rs +++ b/cli/src/commands/debug/tree.rs @@ -17,7 +17,7 @@ use std::io::Write as _; use jj_lib::backend::TreeId; use jj_lib::merged_tree::MergedTree; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPathBuf; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/describe.rs b/cli/src/commands/describe.rs index 814b45a7c..cbde07c9c 100644 --- a/cli/src/commands/describe.rs +++ b/cli/src/commands/describe.rs @@ -14,13 +14,13 @@ use std::collections::HashMap; use std::io; -use std::io::Read; +use std::io::Read as _; use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::Signature; -use jj_lib::commit::CommitIteratorExt; -use jj_lib::object_id::ObjectId; +use jj_lib::commit::CommitIteratorExt as _; +use jj_lib::object_id::ObjectId as _; use tracing::instrument; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/diff.rs b/cli/src/commands/diff.rs index 80d87a5bb..4e8fe3f92 100644 --- a/cli/src/commands/diff.rs +++ b/cli/src/commands/diff.rs @@ -15,9 +15,9 @@ use clap_complete::ArgValueCandidates; use clap_complete::ArgValueCompleter; use indexmap::IndexSet; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::copies::CopyRecords; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::rewrite::merge_commit_trees; use tracing::instrument; diff --git a/cli/src/commands/diffedit.rs b/cli/src/commands/diffedit.rs index 53363a9dd..d07b3521d 100644 --- a/cli/src/commands/diffedit.rs +++ b/cli/src/commands/diffedit.rs @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::matchers::EverythingMatcher; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::rewrite::merge_commit_trees; use tracing::instrument; diff --git a/cli/src/commands/duplicate.rs b/cli/src/commands/duplicate.rs index 6b2b28283..a614aebad 100644 --- a/cli/src/commands/duplicate.rs +++ b/cli/src/commands/duplicate.rs @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::CommitId; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::rewrite::duplicate_commits; use jj_lib::rewrite::duplicate_commits_onto_parents; use jj_lib::rewrite::DuplicateCommitsStats; diff --git a/cli/src/commands/edit.rs b/cli/src/commands/edit.rs index 89251386b..4ba1afe03 100644 --- a/cli/src/commands/edit.rs +++ b/cli/src/commands/edit.rs @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCandidates; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use tracing::instrument; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/evolog.rs b/cli/src/commands/evolog.rs index 4dc1e8f8c..8343de702 100644 --- a/cli/src/commands/evolog.rs +++ b/cli/src/commands/evolog.rs @@ -15,7 +15,7 @@ use std::convert::Infallible; use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::BackendError; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; diff --git a/cli/src/commands/file/chmod.rs b/cli/src/commands/file/chmod.rs index 0f454e5d6..6aa8facbb 100644 --- a/cli/src/commands/file/chmod.rs +++ b/cli/src/commands/file/chmod.rs @@ -16,7 +16,7 @@ use clap_complete::ArgValueCandidates; use clap_complete::ArgValueCompleter; use jj_lib::backend::TreeValue; use jj_lib::merged_tree::MergedTreeBuilder; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use tracing::instrument; use crate::cli_util::print_unmatched_explicit_paths; diff --git a/cli/src/commands/file/show.rs b/cli/src/commands/file/show.rs index fdbae9837..ff256a10b 100644 --- a/cli/src/commands/file/show.rs +++ b/cli/src/commands/file/show.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::io; -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCandidates; use clap_complete::ArgValueCompleter; @@ -24,9 +24,9 @@ use jj_lib::conflicts::MaterializedTreeValue; use jj_lib::fileset::FilePattern; use jj_lib::fileset::FilesetExpression; use jj_lib::merge::MergedTreeValue; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; -use pollster::FutureExt; +use pollster::FutureExt as _; use tracing::instrument; use crate::cli_util::print_unmatched_explicit_paths; diff --git a/cli/src/commands/file/track.rs b/cli/src/commands/file/track.rs index 36132595d..adf5988ac 100644 --- a/cli/src/commands/file/track.rs +++ b/cli/src/commands/file/track.rs @@ -13,10 +13,10 @@ // limitations under the License. use std::io; -use std::io::Write; +use std::io::Write as _; use indoc::writedoc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::repo_path::RepoPathUiConverter; use jj_lib::working_copy::SnapshotStats; use jj_lib::working_copy::UntrackedReason; diff --git a/cli/src/commands/file/untrack.rs b/cli/src/commands/file/untrack.rs index 53435fe1a..0c5f57373 100644 --- a/cli/src/commands/file/untrack.rs +++ b/cli/src/commands/file/untrack.rs @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCompleter; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::merge::Merge; use jj_lib::merged_tree::MergedTreeBuilder; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use tracing::instrument; use crate::cli_util::print_snapshot_stats; diff --git a/cli/src/commands/fix.rs b/cli/src/commands/fix.rs index a597a523e..02dcbc966 100644 --- a/cli/src/commands/fix.rs +++ b/cli/src/commands/fix.rs @@ -14,14 +14,14 @@ use std::collections::HashMap; use std::collections::HashSet; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::process::Stdio; use std::sync::mpsc::channel; use clap_complete::ArgValueCandidates; -use futures::StreamExt; -use itertools::Itertools; +use futures::StreamExt as _; +use itertools::Itertools as _; use jj_lib::backend::BackendError; use jj_lib::backend::CommitId; use jj_lib::backend::FileId; @@ -33,17 +33,17 @@ use jj_lib::matchers::Matcher; use jj_lib::merged_tree::MergedTree; use jj_lib::merged_tree::MergedTreeBuilder; use jj_lib::merged_tree::TreeDiffEntry; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPathBuf; use jj_lib::repo_path::RepoPathUiConverter; use jj_lib::revset::RevsetExpression; -use jj_lib::revset::RevsetIteratorExt; +use jj_lib::revset::RevsetIteratorExt as _; use jj_lib::settings::UserSettings; use jj_lib::store::Store; use jj_lib::tree::Tree; -use pollster::FutureExt; -use rayon::iter::IntoParallelIterator; -use rayon::prelude::ParallelIterator; +use pollster::FutureExt as _; +use rayon::iter::IntoParallelIterator as _; +use rayon::prelude::ParallelIterator as _; use tracing::instrument; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/git/clone.rs b/cli/src/commands/git/clone.rs index 5d363acc8..d94c1b978 100644 --- a/cli/src/commands/git/clone.rs +++ b/cli/src/commands/git/clone.rs @@ -14,14 +14,14 @@ use std::fs; use std::io; -use std::io::Write; +use std::io::Write as _; use std::num::NonZeroU32; use std::path::Path; use jj_lib::git; use jj_lib::git::GitFetch; use jj_lib::refs::RemoteRefSymbol; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::str_util::StringPattern; use jj_lib::workspace::Workspace; diff --git a/cli/src/commands/git/fetch.rs b/cli/src/commands/git/fetch.rs index 89d6b0e59..5ddaa8530 100644 --- a/cli/src/commands/git/fetch.rs +++ b/cli/src/commands/git/fetch.rs @@ -15,11 +15,11 @@ use std::collections::HashSet; use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::config::ConfigGetResultExt as _; use jj_lib::git; use jj_lib::git::GitFetch; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::str_util::StringPattern; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/git/init.rs b/cli/src/commands/git/init.rs index bdeefca1f..b5e165b02 100644 --- a/cli/src/commands/git/init.rs +++ b/cli/src/commands/git/init.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::io; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; use std::str; @@ -26,7 +26,7 @@ use jj_lib::git::parse_git_ref; use jj_lib::git::RefName; use jj_lib::refs::RemoteRefSymbol; use jj_lib::repo::ReadonlyRepo; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::view::View; use jj_lib::workspace::Workspace; diff --git a/cli/src/commands/git/push.rs b/cli/src/commands/git/push.rs index 879d96e9b..21815ecc6 100644 --- a/cli/src/commands/git/push.rs +++ b/cli/src/commands/git/push.rs @@ -16,19 +16,19 @@ use std::collections::HashMap; use std::collections::HashSet; use std::fmt; use std::io; -use std::io::Write; +use std::io::Write as _; use clap::ArgGroup; use clap_complete::ArgValueCandidates; use indexmap::IndexSet; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; use jj_lib::commit::CommitIteratorExt as _; use jj_lib::config::ConfigGetResultExt as _; use jj_lib::git; use jj_lib::git::GitBranchPushTargets; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_store::RefTarget; use jj_lib::refs::classify_bookmark_push_action; use jj_lib::refs::BookmarkPushAction; diff --git a/cli/src/commands/git/remote/add.rs b/cli/src/commands/git/remote/add.rs index 72ef0c755..2e198abbd 100644 --- a/cli/src/commands/git/remote/add.rs +++ b/cli/src/commands/git/remote/add.rs @@ -13,7 +13,7 @@ // limitations under the License. use jj_lib::git; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use crate::cli_util::CommandHelper; use crate::command_error::CommandError; diff --git a/cli/src/commands/git/remote/list.rs b/cli/src/commands/git/remote/list.rs index 5667d91f1..73c9818b5 100644 --- a/cli/src/commands/git/remote/list.rs +++ b/cli/src/commands/git/remote/list.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use jj_lib::git; use jj_lib::repo::Repo as _; diff --git a/cli/src/commands/git/remote/set_url.rs b/cli/src/commands/git/remote/set_url.rs index 8c7cca14b..00197c60e 100644 --- a/cli/src/commands/git/remote/set_url.rs +++ b/cli/src/commands/git/remote/set_url.rs @@ -14,7 +14,7 @@ use clap_complete::ArgValueCandidates; use jj_lib::git; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use crate::cli_util::CommandHelper; use crate::command_error::CommandError; diff --git a/cli/src/commands/help.rs b/cli/src/commands/help.rs index 11981eaa1..ea98baded 100644 --- a/cli/src/commands/help.rs +++ b/cli/src/commands/help.rs @@ -13,12 +13,12 @@ // limitations under the License. use std::fmt::Write as _; -use std::io::Write; +use std::io::Write as _; use clap::builder::PossibleValue; use clap::builder::StyledStr; -use crossterm::style::Stylize; -use itertools::Itertools; +use crossterm::style::Stylize as _; +use itertools::Itertools as _; use tracing::instrument; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/log.rs b/cli/src/commands/log.rs index 59df93106..e2a150701 100644 --- a/cli/src/commands/log.rs +++ b/cli/src/commands/log.rs @@ -22,11 +22,11 @@ use jj_lib::graph::reverse_graph; use jj_lib::graph::GraphEdge; use jj_lib::graph::GraphEdgeType; use jj_lib::graph::TopoGroupedGraphIterator; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::revset::RevsetEvaluationError; use jj_lib::revset::RevsetExpression; use jj_lib::revset::RevsetFilterPredicate; -use jj_lib::revset::RevsetIteratorExt; +use jj_lib::revset::RevsetIteratorExt as _; use jj_lib::settings::UserSettings; use tracing::instrument; diff --git a/cli/src/commands/mod.rs b/cli/src/commands/mod.rs index a7ea31e0d..e51e16840 100644 --- a/cli/src/commands/mod.rs +++ b/cli/src/commands/mod.rs @@ -61,9 +61,9 @@ use std::fmt::Debug; use clap::builder::styling::AnsiColor; use clap::builder::Styles; -use clap::CommandFactory; -use clap::FromArgMatches; -use clap::Subcommand; +use clap::CommandFactory as _; +use clap::FromArgMatches as _; +use clap::Subcommand as _; use clap_complete::engine::SubcommandCandidates; use tracing::instrument; diff --git a/cli/src/commands/new.rs b/cli/src/commands/new.rs index 967cf0123..e6919c54d 100644 --- a/cli/src/commands/new.rs +++ b/cli/src/commands/new.rs @@ -13,12 +13,12 @@ // limitations under the License. use std::collections::HashSet; -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::CommitId; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::rewrite::merge_commit_trees; use jj_lib::rewrite::rebase_commit; use tracing::instrument; diff --git a/cli/src/commands/operation/diff.rs b/cli/src/commands/operation/diff.rs index 60b1eb663..ce8ed19b1 100644 --- a/cli/src/commands/operation/diff.rs +++ b/cli/src/commands/operation/diff.rs @@ -18,7 +18,7 @@ use std::sync::Arc; use clap_complete::ArgValueCandidates; use indexmap::IndexMap; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::ChangeId; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; diff --git a/cli/src/commands/operation/restore.rs b/cli/src/commands/operation/restore.rs index 4412ab384..067ae4401 100644 --- a/cli/src/commands/operation/restore.rs +++ b/cli/src/commands/operation/restore.rs @@ -13,7 +13,7 @@ // limitations under the License. use clap_complete::ArgValueCandidates; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use super::view_with_desired_portions_restored; use super::UndoWhatToRestore; diff --git a/cli/src/commands/operation/show.rs b/cli/src/commands/operation/show.rs index 4d3377056..b3c4ad1a5 100644 --- a/cli/src/commands/operation/show.rs +++ b/cli/src/commands/operation/show.rs @@ -13,7 +13,7 @@ // limitations under the License. use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use super::diff::show_op_diff; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/operation/undo.rs b/cli/src/commands/operation/undo.rs index 2aceb6d4a..6110b0257 100644 --- a/cli/src/commands/operation/undo.rs +++ b/cli/src/commands/operation/undo.rs @@ -13,11 +13,11 @@ // limitations under the License. use clap_complete::ArgValueCandidates; -use itertools::Itertools; -use jj_lib::object_id::ObjectId; +use itertools::Itertools as _; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_store::OpStoreError; use jj_lib::operation::Operation; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use super::view_with_desired_portions_restored; use super::UndoWhatToRestore; diff --git a/cli/src/commands/parallelize.rs b/cli/src/commands/parallelize.rs index 8d03b3590..b619065be 100644 --- a/cli/src/commands/parallelize.rs +++ b/cli/src/commands/parallelize.rs @@ -16,10 +16,10 @@ use std::collections::HashMap; use clap_complete::ArgValueCandidates; use indexmap::IndexSet; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; -use jj_lib::commit::CommitIteratorExt; +use jj_lib::commit::CommitIteratorExt as _; use tracing::instrument; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/rebase.rs b/cli/src/commands/rebase.rs index 79b2dfe33..8f9499419 100644 --- a/cli/src/commands/rebase.rs +++ b/cli/src/commands/rebase.rs @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use std::sync::Arc; use clap::ArgGroup; use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; -use jj_lib::commit::CommitIteratorExt; -use jj_lib::object_id::ObjectId; +use jj_lib::commit::CommitIteratorExt as _; +use jj_lib::object_id::ObjectId as _; use jj_lib::repo::ReadonlyRepo; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::revset::RevsetExpression; -use jj_lib::revset::RevsetIteratorExt; +use jj_lib::revset::RevsetIteratorExt as _; use jj_lib::rewrite::move_commits; use jj_lib::rewrite::EmptyBehaviour; use jj_lib::rewrite::MoveCommitsStats; diff --git a/cli/src/commands/resolve.rs b/cli/src/commands/resolve.rs index 725ed6c36..2091fca6a 100644 --- a/cli/src/commands/resolve.rs +++ b/cli/src/commands/resolve.rs @@ -14,8 +14,8 @@ use clap_complete::ArgValueCandidates; use clap_complete::ArgValueCompleter; -use itertools::Itertools; -use jj_lib::object_id::ObjectId; +use itertools::Itertools as _; +use jj_lib::object_id::ObjectId as _; use tracing::instrument; use crate::cli_util::print_conflicted_paths; diff --git a/cli/src/commands/restore.rs b/cli/src/commands/restore.rs index fa23607ea..69fd3498b 100644 --- a/cli/src/commands/restore.rs +++ b/cli/src/commands/restore.rs @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCandidates; use clap_complete::ArgValueCompleter; use indoc::formatdoc; use itertools::Itertools as _; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use tracing::instrument; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/sign.rs b/cli/src/commands/sign.rs index d69a9cae8..2ab995d89 100644 --- a/cli/src/commands/sign.rs +++ b/cli/src/commands/sign.rs @@ -14,10 +14,10 @@ use clap_complete::ArgValueCandidates; use indexmap::IndexSet; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::commit::Commit; -use jj_lib::commit::CommitIteratorExt; -use jj_lib::repo::Repo; +use jj_lib::commit::CommitIteratorExt as _; +use jj_lib::repo::Repo as _; use jj_lib::signing::SignBehavior; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/simplify_parents.rs b/cli/src/commands/simplify_parents.rs index a842d3607..c09015716 100644 --- a/cli/src/commands/simplify_parents.rs +++ b/cli/src/commands/simplify_parents.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::BackendError; use jj_lib::revset::RevsetExpression; diff --git a/cli/src/commands/sparse/edit.rs b/cli/src/commands/sparse/edit.rs index 496372132..12ab2df8b 100644 --- a/cli/src/commands/sparse/edit.rs +++ b/cli/src/commands/sparse/edit.rs @@ -15,7 +15,7 @@ use std::fmt::Write as _; use std::path::Path; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::repo_path::RepoPathBuf; use tracing::instrument; diff --git a/cli/src/commands/split.rs b/cli/src/commands/split.rs index 81a2de14c..910c978a4 100644 --- a/cli/src/commands/split.rs +++ b/cli/src/commands/split.rs @@ -11,14 +11,14 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use clap_complete::ArgValueCandidates; use clap_complete::ArgValueCompleter; use jj_lib::commit::Commit; use jj_lib::matchers::Matcher; -use jj_lib::object_id::ObjectId; -use jj_lib::repo::Repo; +use jj_lib::object_id::ObjectId as _; +use jj_lib::repo::Repo as _; use jj_lib::rewrite::CommitWithSelection; use tracing::instrument; diff --git a/cli/src/commands/squash.rs b/cli/src/commands/squash.rs index 624190c41..1987c9011 100644 --- a/cli/src/commands/squash.rs +++ b/cli/src/commands/squash.rs @@ -17,10 +17,10 @@ use clap_complete::ArgValueCompleter; use indoc::formatdoc; use itertools::Itertools as _; use jj_lib::commit::Commit; -use jj_lib::commit::CommitIteratorExt; +use jj_lib::commit::CommitIteratorExt as _; use jj_lib::matchers::Matcher; -use jj_lib::object_id::ObjectId; -use jj_lib::repo::Repo; +use jj_lib::object_id::ObjectId as _; +use jj_lib::repo::Repo as _; use jj_lib::rewrite; use jj_lib::rewrite::CommitWithSelection; use tracing::instrument; diff --git a/cli/src/commands/status.rs b/cli/src/commands/status.rs index b0e54858b..0de55b1a3 100644 --- a/cli/src/commands/status.rs +++ b/cli/src/commands/status.rs @@ -14,9 +14,9 @@ use std::io; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::copies::CopyRecords; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::revset::RevsetExpression; use jj_lib::revset::RevsetFilterPredicate; use tracing::instrument; diff --git a/cli/src/commands/unsign.rs b/cli/src/commands/unsign.rs index 5c0017a32..6a74e8075 100644 --- a/cli/src/commands/unsign.rs +++ b/cli/src/commands/unsign.rs @@ -14,9 +14,9 @@ use clap_complete::ArgValueCandidates; use indexmap::IndexSet; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::commit::Commit; -use jj_lib::commit::CommitIteratorExt; +use jj_lib::commit::CommitIteratorExt as _; use jj_lib::signing::SignBehavior; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/version.rs b/cli/src/commands/version.rs index 9981138b6..8ddcd3a0b 100644 --- a/cli/src/commands/version.rs +++ b/cli/src/commands/version.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use tracing::instrument; diff --git a/cli/src/commands/workspace/add.rs b/cli/src/commands/workspace/add.rs index a2be01d85..1baa4959f 100644 --- a/cli/src/commands/workspace/add.rs +++ b/cli/src/commands/workspace/add.rs @@ -14,12 +14,12 @@ use std::fs; -use itertools::Itertools; -use jj_lib::commit::CommitIteratorExt; +use itertools::Itertools as _; +use jj_lib::commit::CommitIteratorExt as _; use jj_lib::file_util; -use jj_lib::file_util::IoResultExt; +use jj_lib::file_util::IoResultExt as _; use jj_lib::op_store::WorkspaceId; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::rewrite::merge_commit_trees; use jj_lib::workspace::Workspace; use tracing::instrument; diff --git a/cli/src/commands/workspace/forget.rs b/cli/src/commands/workspace/forget.rs index bc119179d..6054f6a9d 100644 --- a/cli/src/commands/workspace/forget.rs +++ b/cli/src/commands/workspace/forget.rs @@ -13,7 +13,7 @@ // limitations under the License. use clap_complete::ArgValueCandidates; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::op_store::WorkspaceId; use tracing::instrument; diff --git a/cli/src/commands/workspace/list.rs b/cli/src/commands/workspace/list.rs index 75b76dc5f..2cf55beb3 100644 --- a/cli/src/commands/workspace/list.rs +++ b/cli/src/commands/workspace/list.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use tracing::instrument; use crate::cli_util::CommandHelper; diff --git a/cli/src/commands/workspace/root.rs b/cli/src/commands/workspace/root.rs index f6b2bc098..4136a444c 100644 --- a/cli/src/commands/workspace/root.rs +++ b/cli/src/commands/workspace/root.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use tracing::instrument; diff --git a/cli/src/complete.rs b/cli/src/complete.rs index 6ff4d5d0a..90721827d 100644 --- a/cli/src/complete.rs +++ b/cli/src/complete.rs @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::BufRead; +use std::io::BufRead as _; use clap::builder::StyledStr; use clap::FromArgMatches as _; use clap_complete::CompletionCandidate; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::config::ConfigNamePathBuf; use jj_lib::settings::UserSettings; use jj_lib::workspace::DefaultWorkspaceLoaderFactory; diff --git a/cli/src/config.rs b/cli/src/config.rs index ec256320a..ed79c0b71 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -22,7 +22,7 @@ use std::path::Path; use std::path::PathBuf; use std::process::Command; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::config::ConfigFile; use jj_lib::config::ConfigGetError; use jj_lib::config::ConfigLayer; @@ -207,7 +207,7 @@ fn create_dir_all(path: &Path) -> std::io::Result<()> { dir.recursive(true); #[cfg(unix)] { - use std::os::unix::fs::DirBuilderExt; + use std::os::unix::fs::DirBuilderExt as _; dir.mode(0o700); } dir.create(path) diff --git a/cli/src/description_util.rs b/cli/src/description_util.rs index 33bde5156..5693d99a7 100644 --- a/cli/src/description_util.rs +++ b/cli/src/description_util.rs @@ -10,7 +10,7 @@ use bstr::ByteVec as _; use indexmap::IndexMap; use indoc::indoc; use itertools::FoldWhile; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; use jj_lib::config::ConfigGetError; diff --git a/cli/src/diff_util.rs b/cli/src/diff_util.rs index d42959c0a..37f6f4c52 100644 --- a/cli/src/diff_util.rs +++ b/cli/src/diff_util.rs @@ -26,7 +26,7 @@ use futures::executor::block_on_stream; use futures::stream::BoxStream; use futures::StreamExt as _; use futures::TryStreamExt as _; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::BackendError; use jj_lib::backend::BackendResult; use jj_lib::backend::CommitId; @@ -58,7 +58,7 @@ use jj_lib::files::DiffLineNumber; use jj_lib::matchers::Matcher; use jj_lib::merge::MergedTreeValue; use jj_lib::merged_tree::MergedTree; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::repo::Repo; use jj_lib::repo_path::InvalidRepoPathError; use jj_lib::repo_path::RepoPath; @@ -66,7 +66,7 @@ use jj_lib::repo_path::RepoPathUiConverter; use jj_lib::rewrite::rebase_to_dest_parent; use jj_lib::settings::UserSettings; use jj_lib::store::Store; -use pollster::FutureExt; +use pollster::FutureExt as _; use thiserror::Error; use tracing::instrument; use unicode_width::UnicodeWidthStr as _; diff --git a/cli/src/formatter.rs b/cli/src/formatter.rs index db39c409b..8fb18f640 100644 --- a/cli/src/formatter.rs +++ b/cli/src/formatter.rs @@ -28,7 +28,7 @@ use crossterm::style::Color; use crossterm::style::SetAttribute; use crossterm::style::SetBackgroundColor; use crossterm::style::SetForegroundColor; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::config::ConfigGetError; use jj_lib::config::StackedConfig; use serde::de::Deserialize as _; diff --git a/cli/src/git_util.rs b/cli/src/git_util.rs index 999aba9fc..d3ac2bbb4 100644 --- a/cli/src/git_util.rs +++ b/cli/src/git_util.rs @@ -16,8 +16,8 @@ use std::error; use std::io; -use std::io::Read; -use std::io::Write; +use std::io::Read as _; +use std::io::Write as _; use std::iter; use std::mem; use std::path::Path; @@ -29,7 +29,7 @@ use std::time::Instant; use crossterm::terminal::Clear; use crossterm::terminal::ClearType; use indoc::writedoc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::fmt_util::binary_prefix; use jj_lib::git; use jj_lib::git::FailedRefExport; @@ -42,7 +42,7 @@ use jj_lib::refs::RemoteRefSymbol; use jj_lib::repo::ReadonlyRepo; use jj_lib::repo::Repo; use jj_lib::workspace::Workspace; -use unicode_width::UnicodeWidthStr; +use unicode_width::UnicodeWidthStr as _; use crate::cleanup_guard::CleanupGuard; use crate::command_error::cli_error; diff --git a/cli/src/merge_tools/builtin.rs b/cli/src/merge_tools/builtin.rs index c06713a9f..4ccb5ffdd 100644 --- a/cli/src/merge_tools/builtin.rs +++ b/cli/src/merge_tools/builtin.rs @@ -2,10 +2,10 @@ use std::borrow::Cow; use std::path::Path; use std::sync::Arc; -use futures::StreamExt; -use futures::TryFutureExt; -use futures::TryStreamExt; -use itertools::Itertools; +use futures::StreamExt as _; +use futures::TryFutureExt as _; +use futures::TryStreamExt as _; +use itertools::Itertools as _; use jj_lib::backend::BackendResult; use jj_lib::backend::FileId; use jj_lib::backend::MergedTreeId; @@ -23,11 +23,11 @@ use jj_lib::merge::Merge; use jj_lib::merged_tree::MergedTree; use jj_lib::merged_tree::MergedTreeBuilder; use jj_lib::merged_tree::TreeDiffEntry; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf; use jj_lib::store::Store; -use pollster::FutureExt; +use pollster::FutureExt as _; use thiserror::Error; use super::MergeToolFile; @@ -683,7 +683,7 @@ pub fn edit_merge_builtin( mod tests { use jj_lib::conflicts::extract_as_single_hunk; use jj_lib::merge::MergedTreeValue; - use jj_lib::repo::Repo; + use jj_lib::repo::Repo as _; use testutils::TestRepo; use super::*; diff --git a/cli/src/merge_tools/diff_working_copies.rs b/cli/src/merge_tools/diff_working_copies.rs index a80b3b624..fdf4c916c 100644 --- a/cli/src/merge_tools/diff_working_copies.rs +++ b/cli/src/merge_tools/diff_working_copies.rs @@ -1,12 +1,12 @@ use std::collections::HashMap; use std::fs::File; use std::io; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; -use futures::StreamExt; +use futures::StreamExt as _; use jj_lib::backend::MergedTreeId; use jj_lib::conflicts::ConflictMarkerStyle; use jj_lib::fsmonitor::FsmonitorSettings; @@ -22,7 +22,7 @@ use jj_lib::store::Store; use jj_lib::working_copy::CheckoutError; use jj_lib::working_copy::CheckoutOptions; use jj_lib::working_copy::SnapshotOptions; -use pollster::FutureExt; +use pollster::FutureExt as _; use tempfile::TempDir; use thiserror::Error; diff --git a/cli/src/merge_tools/external.rs b/cli/src/merge_tools/external.rs index 37b47379c..67f2f47f5 100644 --- a/cli/src/merge_tools/external.rs +++ b/cli/src/merge_tools/external.rs @@ -7,7 +7,7 @@ use std::process::Stdio; use std::sync::Arc; use bstr::BString; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::MergedTreeId; use jj_lib::conflicts; use jj_lib::conflicts::choose_materialized_conflict_marker_len; @@ -22,7 +22,7 @@ use jj_lib::merged_tree::MergedTreeBuilder; use jj_lib::repo_path::RepoPathUiConverter; use jj_lib::store::Store; use jj_lib::working_copy::CheckoutOptions; -use pollster::FutureExt; +use pollster::FutureExt as _; use thiserror::Error; use super::diff_working_copies::check_out_trees; diff --git a/cli/src/merge_tools/mod.rs b/cli/src/merge_tools/mod.rs index 49e401234..87ea2ccb6 100644 --- a/cli/src/merge_tools/mod.rs +++ b/cli/src/merge_tools/mod.rs @@ -19,7 +19,7 @@ mod external; use std::sync::Arc; use bstr::BString; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::FileId; use jj_lib::backend::MergedTreeId; use jj_lib::config::ConfigGetError; @@ -38,7 +38,7 @@ use jj_lib::repo_path::RepoPathBuf; use jj_lib::repo_path::RepoPathUiConverter; use jj_lib::settings::UserSettings; use jj_lib::working_copy::SnapshotError; -use pollster::FutureExt; +use pollster::FutureExt as _; use thiserror::Error; use self::builtin::edit_diff_builtin; diff --git a/cli/src/movement_util.rs b/cli/src/movement_util.rs index 840e3234d..accd85936 100644 --- a/cli/src/movement_util.rs +++ b/cli/src/movement_util.rs @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use std::rc::Rc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::revset::ResolvedRevsetExpression; use jj_lib::revset::RevsetExpression; use jj_lib::revset::RevsetFilterPredicate; -use jj_lib::revset::RevsetIteratorExt; +use jj_lib::revset::RevsetIteratorExt as _; use crate::cli_util::short_commit_hash; use crate::cli_util::CommandHelper; diff --git a/cli/src/operation_templater.rs b/cli/src/operation_templater.rs index 5eea5164e..22e7559d8 100644 --- a/cli/src/operation_templater.rs +++ b/cli/src/operation_templater.rs @@ -19,7 +19,7 @@ use std::io; use itertools::Itertools as _; use jj_lib::extensions_map::ExtensionsMap; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_store::OperationId; use jj_lib::operation::Operation; use jj_lib::repo::RepoLoader; diff --git a/cli/src/template_parser.rs b/cli/src/template_parser.rs index 8c5c1daeb..865353a97 100644 --- a/cli/src/template_parser.rs +++ b/cli/src/template_parser.rs @@ -38,7 +38,7 @@ use pest::iterators::Pairs; use pest::pratt_parser::Assoc; use pest::pratt_parser::Op; use pest::pratt_parser::PrattParser; -use pest::Parser; +use pest::Parser as _; use pest_derive::Parser; use thiserror::Error; diff --git a/cli/src/time_util.rs b/cli/src/time_util.rs index c50567838..90d4ecae9 100644 --- a/cli/src/time_util.rs +++ b/cli/src/time_util.rs @@ -2,7 +2,7 @@ use chrono::format::StrftimeItems; use chrono::DateTime; use chrono::FixedOffset; use chrono::LocalResult; -use chrono::TimeZone; +use chrono::TimeZone as _; use chrono::Utc; use jj_lib::backend::Timestamp; use once_cell::sync::Lazy; diff --git a/cli/testing/fake-diff-editor.rs b/cli/testing/fake-diff-editor.rs index e39824b4b..8a8f1b477 100644 --- a/cli/testing/fake-diff-editor.rs +++ b/cli/testing/fake-diff-editor.rs @@ -18,7 +18,7 @@ use std::path::PathBuf; use std::process::exit; use clap::Parser; -use itertools::Itertools; +use itertools::Itertools as _; /// A fake diff-editor, useful for testing #[derive(Parser, Debug)] diff --git a/cli/testing/fake-editor.rs b/cli/testing/fake-editor.rs index 0fa4cda2d..5719c4a0d 100644 --- a/cli/testing/fake-editor.rs +++ b/cli/testing/fake-editor.rs @@ -18,7 +18,7 @@ use std::path::PathBuf; use std::process::exit; use clap::Parser; -use itertools::Itertools; +use itertools::Itertools as _; /// A fake editor, useful for testing // It's overkill to use clap for a single argument, but we already use it in many other places... diff --git a/cli/testing/fake-formatter.rs b/cli/testing/fake-formatter.rs index 952f87a3d..bf30c809b 100644 --- a/cli/testing/fake-formatter.rs +++ b/cli/testing/fake-formatter.rs @@ -13,13 +13,13 @@ // limitations under the License. use std::fs::OpenOptions; -use std::io::Write; +use std::io::Write as _; use std::path::PathBuf; use std::process::ExitCode; use clap::arg; use clap::Parser; -use itertools::Itertools; +use itertools::Itertools as _; /// A fake code formatter, useful for testing /// diff --git a/cli/tests/test_diff_command.rs b/cli/tests/test_diff_command.rs index 6e94e1e31..1643587e4 100644 --- a/cli/tests/test_diff_command.rs +++ b/cli/tests/test_diff_command.rs @@ -13,7 +13,7 @@ // limitations under the License. use indoc::indoc; -use itertools::Itertools; +use itertools::Itertools as _; use crate::common::create_commit; use crate::common::fake_diff_editor_path; @@ -447,7 +447,7 @@ fn test_diff_types() { #[cfg(unix)] { - use std::os::unix::fs::PermissionsExt; + use std::os::unix::fs::PermissionsExt as _; use std::path::PathBuf; // Executable diff --git a/cli/tests/test_file_annotate_command.rs b/cli/tests/test_file_annotate_command.rs index fdbea6f15..245433132 100644 --- a/cli/tests/test_file_annotate_command.rs +++ b/cli/tests/test_file_annotate_command.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::fs::OpenOptions; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use crate::common::TestEnvironment; diff --git a/cli/tests/test_fix_command.rs b/cli/tests/test_fix_command.rs index 80d965dba..2d408108d 100644 --- a/cli/tests/test_fix_command.rs +++ b/cli/tests/test_fix_command.rs @@ -13,7 +13,7 @@ // limitations under the License. #[cfg(unix)] -use std::os::unix::fs::PermissionsExt; +use std::os::unix::fs::PermissionsExt as _; use std::path::PathBuf; use indoc::formatdoc; diff --git a/cli/tests/test_git_colocated.rs b/cli/tests/test_git_colocated.rs index a3bd1bbba..2e8259b58 100644 --- a/cli/tests/test_git_colocated.rs +++ b/cli/tests/test_git_colocated.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::fmt::Write; +use std::fmt::Write as _; use std::path::Path; use testutils::git; diff --git a/cli/tests/test_git_push.rs b/cli/tests/test_git_push.rs index b845ca435..b15180349 100644 --- a/cli/tests/test_git_push.rs +++ b/cli/tests/test_git_push.rs @@ -2321,7 +2321,7 @@ fn test_git_push_rejected_by_remote() { std::fs::write(&hook_path, "#!/bin/sh\nexit 1").unwrap(); #[cfg(unix)] { - use std::os::unix::fs::PermissionsExt; + use std::os::unix::fs::PermissionsExt as _; std::fs::set_permissions(&hook_path, std::fs::Permissions::from_mode(0o700)).unwrap(); } diff --git a/cli/tests/test_git_remotes.rs b/cli/tests/test_git_remotes.rs index 925420267..06dfafd83 100644 --- a/cli/tests/test_git_remotes.rs +++ b/cli/tests/test_git_remotes.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::fs; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; diff --git a/cli/tests/test_gitignores.rs b/cli/tests/test_gitignores.rs index 26aab9ff2..223acc546 100644 --- a/cli/tests/test_gitignores.rs +++ b/cli/tests/test_gitignores.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use testutils::git; diff --git a/cli/tests/test_global_opts.rs b/cli/tests/test_global_opts.rs index df8dd6e6d..9263f44a3 100644 --- a/cli/tests/test_global_opts.rs +++ b/cli/tests/test_global_opts.rs @@ -26,7 +26,7 @@ fn test_non_utf8_arg() { let test_env = TestEnvironment::default(); #[cfg(unix)] let invalid_utf = { - use std::os::unix::ffi::OsStringExt; + use std::os::unix::ffi::OsStringExt as _; OsString::from_vec(vec![0x66, 0x6f, 0x80, 0x6f]) }; #[cfg(windows)] diff --git a/cli/tests/test_operations.rs b/cli/tests/test_operations.rs index 8d15f87df..e8027de0a 100644 --- a/cli/tests/test_operations.rs +++ b/cli/tests/test_operations.rs @@ -15,7 +15,7 @@ use std::path::Path; use std::path::PathBuf; -use itertools::Itertools; +use itertools::Itertools as _; use regex::Regex; use testutils::git; diff --git a/cli/tests/test_sparse_command.rs b/cli/tests/test_sparse_command.rs index e3eecad66..778bd043c 100644 --- a/cli/tests/test_sparse_command.rs +++ b/cli/tests/test_sparse_command.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::io::Write; +use std::io::Write as _; use crate::common::TestEnvironment; diff --git a/lib/proc-macros/src/content_hash.rs b/lib/proc-macros/src/content_hash.rs index 92f24fc7c..2d736eea8 100644 --- a/lib/proc-macros/src/content_hash.rs +++ b/lib/proc-macros/src/content_hash.rs @@ -4,7 +4,7 @@ use quote::format_ident; use quote::quote; use quote::quote_spanned; use syn::parse_quote; -use syn::spanned::Spanned; +use syn::spanned::Spanned as _; use syn::Data; use syn::Field; use syn::Fields; diff --git a/lib/src/annotate.rs b/lib/src/annotate.rs index bbdb13188..6d6ea4218 100644 --- a/lib/src/annotate.rs +++ b/lib/src/annotate.rs @@ -27,7 +27,7 @@ use std::rc::Rc; use bstr::BStr; use bstr::BString; use itertools::Itertools as _; -use pollster::FutureExt; +use pollster::FutureExt as _; use crate::backend::BackendError; use crate::backend::CommitId; diff --git a/lib/src/backend.rs b/lib/src/backend.rs index 930cba063..52892d1d5 100644 --- a/lib/src/backend.rs +++ b/lib/src/backend.rs @@ -29,7 +29,7 @@ use crate::hex_util; use crate::index::Index; use crate::merge::Merge; use crate::object_id::id_type; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::repo_path::RepoPath; use crate::repo_path::RepoPathBuf; use crate::repo_path::RepoPathComponent; diff --git a/lib/src/commit.rs b/lib/src/commit.rs index 51ea5e796..b54360b5d 100644 --- a/lib/src/commit.rs +++ b/lib/src/commit.rs @@ -22,7 +22,7 @@ use std::hash::Hash; use std::hash::Hasher; use std::sync::Arc; -use itertools::Itertools; +use itertools::Itertools as _; use crate::backend; use crate::backend::BackendResult; diff --git a/lib/src/commit_builder.rs b/lib/src/commit_builder.rs index b600c047b..e94697a1c 100644 --- a/lib/src/commit_builder.rs +++ b/lib/src/commit_builder.rs @@ -16,7 +16,7 @@ use std::sync::Arc; -use pollster::FutureExt; +use pollster::FutureExt as _; use crate::backend; use crate::backend::BackendResult; diff --git a/lib/src/conflicts.rs b/lib/src/conflicts.rs index e47ea46b4..35b1ab874 100644 --- a/lib/src/conflicts.rs +++ b/lib/src/conflicts.rs @@ -20,14 +20,14 @@ use std::io::Write; use std::iter::zip; use bstr::BString; -use bstr::ByteSlice; +use bstr::ByteSlice as _; use futures::stream::BoxStream; use futures::try_join; use futures::Stream; -use futures::StreamExt; -use futures::TryStreamExt; -use itertools::Itertools; -use pollster::FutureExt; +use futures::StreamExt as _; +use futures::TryStreamExt as _; +use itertools::Itertools as _; +use pollster::FutureExt as _; use crate::backend::BackendError; use crate::backend::BackendResult; diff --git a/lib/src/content_hash.rs b/lib/src/content_hash.rs index 68ad1d56a..b851aa8f8 100644 --- a/lib/src/content_hash.rs +++ b/lib/src/content_hash.rs @@ -23,7 +23,7 @@ pub trait ContentHash { /// The 512-bit BLAKE2b content hash pub fn blake2b_hash(x: &(impl ContentHash + ?Sized)) -> digest::Output { - use digest::Digest; + use digest::Digest as _; let mut hasher = Blake2b512::default(); x.hash(&mut hasher); hasher.finalize() diff --git a/lib/src/default_index/composite.rs b/lib/src/default_index/composite.rs index c1686b202..51a80990c 100644 --- a/lib/src/default_index/composite.rs +++ b/lib/src/default_index/composite.rs @@ -24,7 +24,7 @@ use std::iter; use std::sync::Arc; use std::sync::Mutex; -use itertools::Itertools; +use itertools::Itertools as _; use ref_cast::ref_cast_custom; use ref_cast::RefCastCustom; @@ -45,7 +45,7 @@ use crate::index::ChangeIdIndex; use crate::index::Index; use crate::index::IndexError; use crate::object_id::HexPrefix; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::object_id::PrefixResolution; use crate::revset::ResolvedExpression; use crate::revset::Revset; diff --git a/lib/src/default_index/entry.rs b/lib/src/default_index/entry.rs index 1f2452979..cf2d6a077 100644 --- a/lib/src/default_index/entry.rs +++ b/lib/src/default_index/entry.rs @@ -25,7 +25,7 @@ use super::composite::CompositeIndex; use super::composite::DynIndexSegment; use crate::backend::ChangeId; use crate::backend::CommitId; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; /// Global index position. #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] diff --git a/lib/src/default_index/mod.rs b/lib/src/default_index/mod.rs index 2badbe750..a5ba3f8aa 100644 --- a/lib/src/default_index/mod.rs +++ b/lib/src/default_index/mod.rs @@ -47,12 +47,12 @@ pub use self::store::DefaultIndexStoreInitError; mod tests { use std::sync::Arc; - use itertools::Itertools; + use itertools::Itertools as _; use smallvec::smallvec_inline; use test_case::test_case; use super::composite::DynIndexSegment; - use super::composite::IndexSegment; + use super::composite::IndexSegment as _; use super::entry::SmallIndexPositionsVec; use super::mutable::MutableIndexSegment; use super::*; @@ -60,9 +60,9 @@ mod tests { use crate::backend::CommitId; use crate::default_index::entry::LocalPosition; use crate::default_index::entry::SmallLocalPositionsVec; - use crate::index::Index; + use crate::index::Index as _; use crate::object_id::HexPrefix; - use crate::object_id::ObjectId; + use crate::object_id::ObjectId as _; use crate::object_id::PrefixResolution; use crate::tests::new_temp_dir; diff --git a/lib/src/default_index/mutable.rs b/lib/src/default_index/mutable.rs index 53f674eae..9309d8ac0 100644 --- a/lib/src/default_index/mutable.rs +++ b/lib/src/default_index/mutable.rs @@ -19,14 +19,14 @@ use std::cmp::max; use std::collections::BTreeMap; use std::collections::HashMap; use std::io; -use std::io::Write; +use std::io::Write as _; use std::ops::Bound; use std::path::Path; use std::sync::Arc; use blake2::Blake2b512; -use digest::Digest; -use itertools::Itertools; +use digest::Digest as _; +use itertools::Itertools as _; use smallvec::smallvec; use smallvec::SmallVec; use tempfile::NamedTempFile; diff --git a/lib/src/default_index/revset_engine.rs b/lib/src/default_index/revset_engine.rs index 83ecc7cc1..2016ea168 100644 --- a/lib/src/default_index/revset_engine.rs +++ b/lib/src/default_index/revset_engine.rs @@ -28,7 +28,7 @@ use std::str; use std::sync::Arc; use futures::StreamExt as _; -use itertools::Itertools; +use itertools::Itertools as _; use pollster::FutureExt as _; use super::rev_walk::EagerRevWalk; diff --git a/lib/src/default_index/store.rs b/lib/src/default_index/store.rs index a0a6b5cfe..707c41462 100644 --- a/lib/src/default_index/store.rs +++ b/lib/src/default_index/store.rs @@ -18,12 +18,12 @@ use std::any::Any; use std::collections::HashSet; use std::fs; use std::io; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; -use itertools::Itertools; +use itertools::Itertools as _; use tempfile::NamedTempFile; use thiserror::Error; @@ -40,13 +40,13 @@ use crate::file_util; use crate::file_util::persist_content_addressed_temp_file; use crate::file_util::IoResultExt as _; use crate::file_util::PathError; -use crate::index::Index; +use crate::index::Index as _; use crate::index::IndexReadError; use crate::index::IndexStore; use crate::index::IndexWriteError; use crate::index::MutableIndex; use crate::index::ReadonlyIndex; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::op_store::OpStoreError; use crate::op_store::OperationId; use crate::operation::Operation; diff --git a/lib/src/diff.rs b/lib/src/diff.rs index 4d7be3710..17cd6edba 100644 --- a/lib/src/diff.rs +++ b/lib/src/diff.rs @@ -25,7 +25,7 @@ use std::slice; use bstr::BStr; use hashbrown::HashTable; -use itertools::Itertools; +use itertools::Itertools as _; use smallvec::smallvec; use smallvec::SmallVec; diff --git a/lib/src/file_util.rs b/lib/src/file_util.rs index 26356b5dc..fa2c3b349 100644 --- a/lib/src/file_util.rs +++ b/lib/src/file_util.rs @@ -210,7 +210,7 @@ mod platform { #[cfg(test)] mod tests { - use std::io::Write; + use std::io::Write as _; use test_case::test_case; diff --git a/lib/src/files.rs b/lib/src/files.rs index 3139ec6b0..5d1ead711 100644 --- a/lib/src/files.rs +++ b/lib/src/files.rs @@ -21,7 +21,7 @@ use std::mem; use bstr::BStr; use bstr::BString; -use itertools::Itertools; +use itertools::Itertools as _; use crate::diff::Diff; use crate::diff::DiffHunk; diff --git a/lib/src/fileset_parser.rs b/lib/src/fileset_parser.rs index 31351ff6f..72f5cc88c 100644 --- a/lib/src/fileset_parser.rs +++ b/lib/src/fileset_parser.rs @@ -22,7 +22,7 @@ use pest::iterators::Pair; use pest::pratt_parser::Assoc; use pest::pratt_parser::Op; use pest::pratt_parser::PrattParser; -use pest::Parser; +use pest::Parser as _; use pest_derive::Parser; use thiserror::Error; diff --git a/lib/src/fsmonitor.rs b/lib/src/fsmonitor.rs index b8585e3a3..6c0c2671b 100644 --- a/lib/src/fsmonitor.rs +++ b/lib/src/fsmonitor.rs @@ -85,7 +85,7 @@ pub mod watchman { use std::path::Path; use std::path::PathBuf; - use itertools::Itertools; + use itertools::Itertools as _; use thiserror::Error; use tracing::info; use tracing::instrument; diff --git a/lib/src/git.rs b/lib/src/git.rs index 36c2f97bf..dd5341e14 100644 --- a/lib/src/git.rs +++ b/lib/src/git.rs @@ -28,7 +28,7 @@ use std::str; use bstr::BStr; use bstr::BString; -use itertools::Itertools; +use itertools::Itertools as _; use thiserror::Error; use crate::backend::BackendError; @@ -43,9 +43,9 @@ use crate::git_subprocess::GitSubprocessContext; use crate::git_subprocess::GitSubprocessError; use crate::index::Index; use crate::merged_tree::MergedTree; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::op_store::RefTarget; -use crate::op_store::RefTargetOptionExt; +use crate::op_store::RefTargetOptionExt as _; use crate::op_store::RemoteRef; use crate::op_store::RemoteRefState; use crate::refs; diff --git a/lib/src/git_backend.rs b/lib/src/git_backend.rs index 68a459cc0..469db208c 100644 --- a/lib/src/git_backend.rs +++ b/lib/src/git_backend.rs @@ -38,10 +38,10 @@ use futures::stream::BoxStream; use gix::bstr::BString; use gix::objs::CommitRef; use gix::objs::CommitRefIter; -use gix::objs::WriteTo; -use itertools::Itertools; -use pollster::FutureExt; -use prost::Message; +use gix::objs::WriteTo as _; +use itertools::Itertools as _; +use pollster::FutureExt as _; +use prost::Message as _; use smallvec::SmallVec; use thiserror::Error; @@ -82,7 +82,7 @@ use crate::repo_path::RepoPathComponentBuf; use crate::settings::UserSettings; use crate::stacked_table::MutableTable; use crate::stacked_table::ReadonlyTable; -use crate::stacked_table::TableSegment; +use crate::stacked_table::TableSegment as _; use crate::stacked_table::TableStore; use crate::stacked_table::TableStoreError; @@ -1535,8 +1535,8 @@ fn bytes_vec_from_json(value: &serde_json::Value) -> Vec { #[cfg(test)] mod tests { use assert_matches::assert_matches; - use hex::ToHex; - use pollster::FutureExt; + use hex::ToHex as _; + use pollster::FutureExt as _; use test_case::test_case; use super::*; diff --git a/lib/src/git_subprocess.rs b/lib/src/git_subprocess.rs index ad0edbc11..3dbbd1686 100644 --- a/lib/src/git_subprocess.rs +++ b/lib/src/git_subprocess.rs @@ -24,8 +24,8 @@ use std::process::Output; use std::process::Stdio; use std::thread; -use bstr::ByteSlice; -use itertools::Itertools; +use bstr::ByteSlice as _; +use itertools::Itertools as _; use thiserror::Error; use crate::git::Progress; diff --git a/lib/src/gpg_signing.rs b/lib/src/gpg_signing.rs index a9e19e19f..f2fc15973 100644 --- a/lib/src/gpg_signing.rs +++ b/lib/src/gpg_signing.rs @@ -17,7 +17,7 @@ use std::ffi::OsString; use std::fmt::Debug; use std::io; -use std::io::Write; +use std::io::Write as _; use std::process::Command; use std::process::ExitStatus; use std::process::Stdio; diff --git a/lib/src/local_backend.rs b/lib/src/local_backend.rs index 5363bce01..2b3b77fce 100644 --- a/lib/src/local_backend.rs +++ b/lib/src/local_backend.rs @@ -19,18 +19,18 @@ use std::fmt::Debug; use std::fs; use std::fs::File; use std::io::Read; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; use std::time::SystemTime; use async_trait::async_trait; use blake2::Blake2b512; -use blake2::Digest; +use blake2::Digest as _; use futures::stream; use futures::stream::BoxStream; -use pollster::FutureExt; -use prost::Message; +use pollster::FutureExt as _; +use prost::Message as _; use tempfile::NamedTempFile; use crate::backend::make_root_commit; @@ -543,7 +543,7 @@ fn conflict_term_to_proto(part: &ConflictTerm) -> crate::protos::local_store::co #[cfg(test)] mod tests { use assert_matches::assert_matches; - use pollster::FutureExt; + use pollster::FutureExt as _; use super::*; use crate::tests::new_temp_dir; diff --git a/lib/src/local_working_copy.rs b/lib/src/local_working_copy.rs index 1a5fb4828..3fd9baa88 100644 --- a/lib/src/local_working_copy.rs +++ b/lib/src/local_working_copy.rs @@ -26,12 +26,12 @@ use std::fs::Metadata; use std::fs::OpenOptions; use std::io; use std::io::Read; -use std::io::Write; +use std::io::Write as _; use std::iter; use std::mem; use std::ops::Range; #[cfg(unix)] -use std::os::unix::fs::PermissionsExt; +use std::os::unix::fs::PermissionsExt as _; use std::path::Path; use std::path::PathBuf; use std::slice; @@ -42,15 +42,15 @@ use std::sync::OnceLock; use std::time::UNIX_EPOCH; use either::Either; -use futures::StreamExt; +use futures::StreamExt as _; use itertools::EitherOrBoth; -use itertools::Itertools; +use itertools::Itertools as _; use once_cell::unsync::OnceCell; -use pollster::FutureExt; -use prost::Message; -use rayon::iter::IntoParallelIterator; -use rayon::prelude::IndexedParallelIterator; -use rayon::prelude::ParallelIterator; +use pollster::FutureExt as _; +use prost::Message as _; +use rayon::iter::IntoParallelIterator as _; +use rayon::prelude::IndexedParallelIterator as _; +use rayon::prelude::ParallelIterator as _; use tempfile::NamedTempFile; use thiserror::Error; use tracing::instrument; @@ -93,7 +93,7 @@ use crate::merge::MergedTreeValue; use crate::merged_tree::MergedTree; use crate::merged_tree::MergedTreeBuilder; use crate::merged_tree::TreeDiffEntry; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::op_store::OperationId; use crate::op_store::WorkspaceId; use crate::repo_path::RepoPath; diff --git a/lib/src/merge.rs b/lib/src/merge.rs index 2bafa53a5..f10976fc0 100644 --- a/lib/src/merge.rs +++ b/lib/src/merge.rs @@ -25,7 +25,7 @@ use std::iter::zip; use std::slice; use std::sync::Arc; -use itertools::Itertools; +use itertools::Itertools as _; use smallvec::smallvec_inline; use smallvec::SmallVec; diff --git a/lib/src/merged_tree.rs b/lib/src/merged_tree.rs index 8c58bb45a..a28196ca4 100644 --- a/lib/src/merged_tree.rs +++ b/lib/src/merged_tree.rs @@ -30,12 +30,12 @@ use std::vec; use either::Either; use futures::future::BoxFuture; use futures::stream::BoxStream; -use futures::stream::StreamExt; +use futures::stream::StreamExt as _; use futures::Stream; -use futures::TryStreamExt; +use futures::TryStreamExt as _; use itertools::EitherOrBoth; -use itertools::Itertools; -use pollster::FutureExt; +use itertools::Itertools as _; +use pollster::FutureExt as _; use crate::backend; use crate::backend::BackendResult; diff --git a/lib/src/op_heads_store.rs b/lib/src/op_heads_store.rs index b7c29e002..d9494c6bc 100644 --- a/lib/src/op_heads_store.rs +++ b/lib/src/op_heads_store.rs @@ -19,7 +19,7 @@ use std::collections::HashSet; use std::fmt::Debug; use std::sync::Arc; -use itertools::Itertools; +use itertools::Itertools as _; use thiserror::Error; use crate::dag_walk; diff --git a/lib/src/op_store.rs b/lib/src/op_store.rs index 3c9e71d8f..f46721db1 100644 --- a/lib/src/op_store.rs +++ b/lib/src/op_store.rs @@ -35,7 +35,7 @@ use crate::content_hash::ContentHash; use crate::merge::Merge; use crate::object_id::id_type; use crate::object_id::HexPrefix; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::object_id::PrefixResolution; #[derive(ContentHash, PartialEq, Eq, PartialOrd, Ord, Clone, Hash)] diff --git a/lib/src/repo.rs b/lib/src/repo.rs index 09de05366..c1dda4d10 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -24,7 +24,7 @@ use std::path::Path; use std::slice; use std::sync::Arc; -use itertools::Itertools; +use itertools::Itertools as _; use once_cell::sync::OnceCell; use thiserror::Error; use tracing::instrument; @@ -57,7 +57,7 @@ use crate::index::ReadonlyIndex; use crate::local_backend::LocalBackend; use crate::merge::MergeBuilder; use crate::object_id::HexPrefix; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::object_id::PrefixResolution; use crate::op_heads_store; use crate::op_heads_store::OpHeadResolutionError; @@ -81,7 +81,7 @@ use crate::refs::merge_remote_refs; use crate::refs::RemoteRefSymbol; use crate::revset; use crate::revset::RevsetExpression; -use crate::revset::RevsetIteratorExt; +use crate::revset::RevsetIteratorExt as _; use crate::rewrite::merge_commit_trees; use crate::rewrite::rebase_commit_with_options; use crate::rewrite::CommitRewriter; diff --git a/lib/src/repo_path.rs b/lib/src/repo_path.rs index 9b43bee2a..7af13a023 100644 --- a/lib/src/repo_path.rs +++ b/lib/src/repo_path.rs @@ -25,7 +25,7 @@ use std::path::Component; use std::path::Path; use std::path::PathBuf; -use itertools::Itertools; +use itertools::Itertools as _; use ref_cast::ref_cast_custom; use ref_cast::RefCastCustom; use thiserror::Error; diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 07b5daeeb..73007fe79 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -23,7 +23,7 @@ use std::ops::Range; use std::rc::Rc; use std::sync::Arc; -use itertools::Itertools; +use itertools::Itertools as _; use once_cell::sync::Lazy; use thiserror::Error; diff --git a/lib/src/revset_parser.rs b/lib/src/revset_parser.rs index 432889e81..df5e42c30 100644 --- a/lib/src/revset_parser.rs +++ b/lib/src/revset_parser.rs @@ -26,7 +26,7 @@ use pest::iterators::Pairs; use pest::pratt_parser::Assoc; use pest::pratt_parser::Op; use pest::pratt_parser::PrattParser; -use pest::Parser; +use pest::Parser as _; use pest_derive::Parser; use thiserror::Error; diff --git a/lib/src/rewrite.rs b/lib/src/rewrite.rs index 2ba0baee8..acc76b573 100644 --- a/lib/src/rewrite.rs +++ b/lib/src/rewrite.rs @@ -18,11 +18,11 @@ use std::collections::HashMap; use std::collections::HashSet; use std::sync::Arc; -use futures::StreamExt; +use futures::StreamExt as _; use indexmap::IndexMap; use indexmap::IndexSet; -use itertools::Itertools; -use pollster::FutureExt; +use itertools::Itertools as _; +use pollster::FutureExt as _; use tracing::instrument; use crate::backend::BackendError; @@ -30,7 +30,7 @@ use crate::backend::BackendResult; use crate::backend::CommitId; use crate::backend::MergedTreeId; use crate::commit::Commit; -use crate::commit::CommitIteratorExt; +use crate::commit::CommitIteratorExt as _; use crate::commit_builder::CommitBuilder; use crate::dag_walk; use crate::index::Index; @@ -44,7 +44,7 @@ use crate::repo::MutableRepo; use crate::repo::Repo; use crate::repo_path::RepoPath; use crate::revset::RevsetExpression; -use crate::revset::RevsetIteratorExt; +use crate::revset::RevsetIteratorExt as _; use crate::store::Store; /// Merges `commits` and tries to resolve any conflicts recursively. diff --git a/lib/src/secret_backend.rs b/lib/src/secret_backend.rs index 54c4e0dbd..83a9af9af 100644 --- a/lib/src/secret_backend.rs +++ b/lib/src/secret_backend.rs @@ -39,7 +39,7 @@ use crate::backend::Tree; use crate::backend::TreeId; use crate::git_backend::GitBackend; use crate::index::Index; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::repo_path::RepoPath; use crate::repo_path::RepoPathBuf; use crate::settings::UserSettings; diff --git a/lib/src/simple_op_heads_store.rs b/lib/src/simple_op_heads_store.rs index 8c39f5271..b9e9d3fee 100644 --- a/lib/src/simple_op_heads_store.rs +++ b/lib/src/simple_op_heads_store.rs @@ -28,7 +28,7 @@ use crate::backend::BackendInitError; use crate::file_util::IoResultExt as _; use crate::file_util::PathError; use crate::lock::FileLock; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::op_heads_store::OpHeadsStore; use crate::op_heads_store::OpHeadsStoreError; use crate::op_heads_store::OpHeadsStoreLock; diff --git a/lib/src/simple_op_store.rs b/lib/src/simple_op_store.rs index 5b25812a4..5f681d9f0 100644 --- a/lib/src/simple_op_store.rs +++ b/lib/src/simple_op_store.rs @@ -22,13 +22,13 @@ use std::fmt::Debug; use std::fs; use std::io; use std::io::ErrorKind; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; use std::time::SystemTime; use itertools::Itertools as _; -use prost::Message; +use prost::Message as _; use tempfile::NamedTempFile; use thiserror::Error; diff --git a/lib/src/ssh_signing.rs b/lib/src/ssh_signing.rs index 7a26e1463..7db174fcd 100644 --- a/lib/src/ssh_signing.rs +++ b/lib/src/ssh_signing.rs @@ -16,7 +16,7 @@ use std::ffi::OsString; use std::fmt::Debug; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; use std::process::Command; @@ -278,7 +278,7 @@ impl SigningBackend for SshBackend { #[cfg(test)] mod tests { use std::fs::File; - use std::io::Read; + use std::io::Read as _; use super::*; diff --git a/lib/src/stacked_table.rs b/lib/src/stacked_table.rs index 1bf4998f3..360c87d29 100644 --- a/lib/src/stacked_table.rs +++ b/lib/src/stacked_table.rs @@ -28,13 +28,13 @@ use std::collections::HashMap; use std::fs::File; use std::io; use std::io::Read; -use std::io::Write; +use std::io::Write as _; use std::path::PathBuf; use std::sync::Arc; use std::sync::RwLock; use blake2::Blake2b512; -use blake2::Digest; +use blake2::Digest as _; use tempfile::NamedTempFile; use thiserror::Error; diff --git a/lib/src/store.rs b/lib/src/store.rs index 2f63e9f14..1f8254bdc 100644 --- a/lib/src/store.rs +++ b/lib/src/store.rs @@ -24,7 +24,7 @@ use std::time::SystemTime; use clru::CLruCache; use futures::stream::BoxStream; -use pollster::FutureExt; +use pollster::FutureExt as _; use crate::backend; use crate::backend::Backend; diff --git a/lib/src/test_signing_backend.rs b/lib/src/test_signing_backend.rs index 2c6482593..2ca45f7dc 100644 --- a/lib/src/test_signing_backend.rs +++ b/lib/src/test_signing_backend.rs @@ -15,7 +15,7 @@ //! Generic APIs to work with cryptographic signatures created and verified by //! various backends. -use hex::ToHex; +use hex::ToHex as _; use jj_lib::content_hash::blake2b_hash; use jj_lib::signing::SigStatus; use jj_lib::signing::SignError; diff --git a/lib/src/transaction.rs b/lib/src/transaction.rs index 4f21028c4..90ead7e49 100644 --- a/lib/src/transaction.rs +++ b/lib/src/transaction.rs @@ -28,7 +28,7 @@ use crate::op_store::OperationMetadata; use crate::operation::Operation; use crate::repo::MutableRepo; use crate::repo::ReadonlyRepo; -use crate::repo::Repo; +use crate::repo::Repo as _; use crate::repo::RepoLoader; use crate::repo::RepoLoaderError; use crate::settings::UserSettings; diff --git a/lib/src/tree.rs b/lib/src/tree.rs index 789d37f67..4da714576 100644 --- a/lib/src/tree.rs +++ b/lib/src/tree.rs @@ -19,11 +19,11 @@ use std::fmt::Error; use std::fmt::Formatter; use std::hash::Hash; use std::hash::Hasher; -use std::io::Read; +use std::io::Read as _; use std::sync::Arc; use futures::future::try_join_all; -use itertools::Itertools; +use itertools::Itertools as _; use tracing::instrument; use crate::backend; @@ -40,7 +40,7 @@ use crate::matchers::EverythingMatcher; use crate::matchers::Matcher; use crate::merge::Merge; use crate::merge::MergedTreeVal; -use crate::object_id::ObjectId; +use crate::object_id::ObjectId as _; use crate::repo_path::RepoPath; use crate::repo_path::RepoPathBuf; use crate::repo_path::RepoPathComponent; diff --git a/lib/src/tree_builder.rs b/lib/src/tree_builder.rs index 57da7d33b..4c00d9e40 100644 --- a/lib/src/tree_builder.rs +++ b/lib/src/tree_builder.rs @@ -17,7 +17,7 @@ use std::collections::BTreeMap; use std::sync::Arc; -use pollster::FutureExt; +use pollster::FutureExt as _; use crate::backend; use crate::backend::BackendResult; diff --git a/lib/src/union_find.rs b/lib/src/union_find.rs index dc66718f3..b1778827e 100644 --- a/lib/src/union_find.rs +++ b/lib/src/union_find.rs @@ -99,7 +99,7 @@ where #[cfg(test)] mod tests { - use itertools::Itertools; + use itertools::Itertools as _; use super::*; diff --git a/lib/src/view.rs b/lib/src/view.rs index 8a47f80a1..6da81756a 100644 --- a/lib/src/view.rs +++ b/lib/src/view.rs @@ -17,7 +17,7 @@ use std::collections::BTreeMap; use std::collections::HashSet; -use itertools::Itertools; +use itertools::Itertools as _; use thiserror::Error; use crate::backend::CommitId; diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index 4bab1f5c5..e9e220266 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -21,7 +21,7 @@ use std::ffi::OsString; use std::path::PathBuf; use std::sync::Arc; -use itertools::Itertools; +use itertools::Itertools as _; use thiserror::Error; use tracing::instrument; @@ -41,7 +41,7 @@ use crate::op_store::OperationId; use crate::op_store::WorkspaceId; use crate::operation::Operation; use crate::repo::ReadonlyRepo; -use crate::repo::Repo; +use crate::repo::Repo as _; use crate::repo::RewriteRootCommit; use crate::repo_path::InvalidRepoPathError; use crate::repo_path::RepoPath; diff --git a/lib/src/workspace.rs b/lib/src/workspace.rs index a996d141b..41fc18d05 100644 --- a/lib/src/workspace.rs +++ b/lib/src/workspace.rs @@ -18,7 +18,7 @@ use std::collections::HashMap; use std::fs; use std::fs::File; use std::io; -use std::io::Write; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; @@ -43,7 +43,7 @@ use crate::repo::IndexStoreInitializer; use crate::repo::OpHeadsStoreInitializer; use crate::repo::OpStoreInitializer; use crate::repo::ReadonlyRepo; -use crate::repo::Repo; +use crate::repo::Repo as _; use crate::repo::RepoInitError; use crate::repo::RepoLoader; use crate::repo::StoreFactories; diff --git a/lib/tests/test_bad_locking.rs b/lib/tests/test_bad_locking.rs index 9d50dcb19..a229f79ba 100644 --- a/lib/tests/test_bad_locking.rs +++ b/lib/tests/test_bad_locking.rs @@ -14,8 +14,8 @@ use std::path::Path; -use itertools::Itertools; -use jj_lib::repo::Repo; +use itertools::Itertools as _; +use jj_lib::repo::Repo as _; use jj_lib::repo::StoreFactories; use jj_lib::workspace::default_working_copy_factories; use jj_lib::workspace::Workspace; diff --git a/lib/tests/test_commit_builder.rs b/lib/tests/test_commit_builder.rs index ddd297833..96ab2eeee 100644 --- a/lib/tests/test_commit_builder.rs +++ b/lib/tests/test_commit_builder.rs @@ -14,7 +14,7 @@ use futures::StreamExt as _; use indoc::indoc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::ChangeId; use jj_lib::backend::MillisSinceEpoch; use jj_lib::backend::Signature; @@ -24,7 +24,7 @@ use jj_lib::config::ConfigSource; use jj_lib::config::StackedConfig; use jj_lib::matchers::EverythingMatcher; use jj_lib::merged_tree::MergedTree; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf; use jj_lib::rewrite::RebaseOptions; diff --git a/lib/tests/test_commit_concurrent.rs b/lib/tests/test_commit_concurrent.rs index 413fb59b7..3fb18c472 100644 --- a/lib/tests/test_commit_concurrent.rs +++ b/lib/tests/test_commit_concurrent.rs @@ -18,7 +18,7 @@ use std::thread; use jj_lib::dag_walk; use jj_lib::repo::ReadonlyRepo; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use test_case::test_case; use testutils::write_random_commit; use testutils::TestRepoBackend; diff --git a/lib/tests/test_conflicts.rs b/lib/tests/test_conflicts.rs index 9ac8cccc7..d6600ff00 100644 --- a/lib/tests/test_conflicts.rs +++ b/lib/tests/test_conflicts.rs @@ -13,7 +13,7 @@ // limitations under the License. use indoc::indoc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::FileId; use jj_lib::conflicts::choose_materialized_conflict_marker_len; use jj_lib::conflicts::extract_as_single_hunk; @@ -23,10 +23,10 @@ use jj_lib::conflicts::update_from_content; use jj_lib::conflicts::ConflictMarkerStyle; use jj_lib::conflicts::MIN_CONFLICT_MARKER_LEN; use jj_lib::merge::Merge; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::store::Store; -use pollster::FutureExt; +use pollster::FutureExt as _; use testutils::TestRepo; #[test] diff --git a/lib/tests/test_default_revset_graph_iterator.rs b/lib/tests/test_default_revset_graph_iterator.rs index 9a7922b62..f33938f54 100644 --- a/lib/tests/test_default_revset_graph_iterator.rs +++ b/lib/tests/test_default_revset_graph_iterator.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::CommitId; use jj_lib::commit::Commit; use jj_lib::default_index::revset_engine::evaluate; diff --git a/lib/tests/test_git.rs b/lib/tests/test_git.rs index 30dea4822..bccb2456b 100644 --- a/lib/tests/test_git.rs +++ b/lib/tests/test_git.rs @@ -15,7 +15,7 @@ use std::collections::BTreeMap; use std::collections::HashSet; use std::fs; -use std::io::Write; +use std::io::Write as _; use std::iter; use std::path::Path; use std::path::PathBuf; @@ -25,7 +25,7 @@ use std::sync::Barrier; use std::thread; use assert_matches::assert_matches; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::BackendError; use jj_lib::backend::ChangeId; use jj_lib::backend::CommitId; @@ -48,7 +48,7 @@ use jj_lib::git::GitRefKind; use jj_lib::git::GitRefUpdate; use jj_lib::git::RefName; use jj_lib::git_backend::GitBackend; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_store::BookmarkTarget; use jj_lib::op_store::RefTarget; use jj_lib::op_store::RemoteRef; @@ -57,7 +57,7 @@ use jj_lib::refs::BookmarkPushUpdate; use jj_lib::refs::RemoteRefSymbol; use jj_lib::repo::MutableRepo; use jj_lib::repo::ReadonlyRepo; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf; use jj_lib::settings::GitSettings; diff --git a/lib/tests/test_git_backend.rs b/lib/tests/test_git_backend.rs index 9b77cf851..9ad66b01f 100644 --- a/lib/tests/test_git_backend.rs +++ b/lib/tests/test_git_backend.rs @@ -26,7 +26,7 @@ use jj_lib::backend::CopyRecord; use jj_lib::commit::Commit; use jj_lib::git_backend::GitBackend; use jj_lib::repo::ReadonlyRepo; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf; use jj_lib::store::Store; diff --git a/lib/tests/test_gpg.rs b/lib/tests/test_gpg.rs index 3211ed0b6..6bf7cc3bc 100644 --- a/lib/tests/test_gpg.rs +++ b/lib/tests/test_gpg.rs @@ -1,8 +1,8 @@ #[cfg(unix)] use std::fs::Permissions; -use std::io::Write; +use std::io::Write as _; #[cfg(unix)] -use std::os::unix::prelude::PermissionsExt; +use std::os::unix::prelude::PermissionsExt as _; use std::process::Command; use std::process::Stdio; @@ -11,7 +11,7 @@ use insta::assert_debug_snapshot; use jj_lib::gpg_signing::GpgBackend; use jj_lib::signing::SigStatus; use jj_lib::signing::SignError; -use jj_lib::signing::SigningBackend; +use jj_lib::signing::SigningBackend as _; static PRIVATE_KEY: &str = r#"-----BEGIN PGP PRIVATE KEY BLOCK----- diff --git a/lib/tests/test_id_prefix.rs b/lib/tests/test_id_prefix.rs index 8501abc38..9482cb006 100644 --- a/lib/tests/test_id_prefix.rs +++ b/lib/tests/test_id_prefix.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::ChangeId; use jj_lib::backend::CommitId; use jj_lib::backend::MillisSinceEpoch; @@ -20,11 +20,11 @@ use jj_lib::backend::Signature; use jj_lib::backend::Timestamp; use jj_lib::id_prefix::IdPrefixContext; use jj_lib::object_id::HexPrefix; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::object_id::PrefixResolution::AmbiguousMatch; use jj_lib::object_id::PrefixResolution::NoMatch; use jj_lib::object_id::PrefixResolution::SingleMatch; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::revset::RevsetExpression; use testutils::TestRepo; use testutils::TestRepoBackend; diff --git a/lib/tests/test_index.rs b/lib/tests/test_index.rs index 1f9bb5aaa..76d0bd05d 100644 --- a/lib/tests/test_index.rs +++ b/lib/tests/test_index.rs @@ -36,7 +36,7 @@ use jj_lib::op_store::RemoteRef; use jj_lib::refs::RemoteRefSymbol; use jj_lib::repo::MutableRepo; use jj_lib::repo::ReadonlyRepo; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::revset::ResolvedExpression; use jj_lib::revset::GENERATION_RANGE_FULL; use maplit::hashset; diff --git a/lib/tests/test_init.rs b/lib/tests/test_init.rs index 4eda5df30..633dbc268 100644 --- a/lib/tests/test_init.rs +++ b/lib/tests/test_init.rs @@ -18,7 +18,7 @@ use std::path::PathBuf; use jj_lib::config::StackedConfig; use jj_lib::git_backend::GitBackend; use jj_lib::op_store::WorkspaceId; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::settings::UserSettings; use jj_lib::workspace::Workspace; use test_case::test_case; diff --git a/lib/tests/test_local_working_copy.rs b/lib/tests/test_local_working_copy.rs index 9b2b1f676..eaa0e7ab4 100644 --- a/lib/tests/test_local_working_copy.rs +++ b/lib/tests/test_local_working_copy.rs @@ -13,7 +13,7 @@ // limitations under the License. #[cfg(unix)] -use std::os::unix::fs::PermissionsExt; +use std::os::unix::fs::PermissionsExt as _; #[cfg(unix)] use std::os::unix::net::UnixListener; use std::path::Path; @@ -22,7 +22,7 @@ use std::sync::Arc; use assert_matches::assert_matches; use indoc::indoc; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::MergedTreeId; use jj_lib::backend::TreeId; use jj_lib::backend::TreeValue; @@ -38,7 +38,7 @@ use jj_lib::merged_tree::MergedTreeBuilder; use jj_lib::op_store::OperationId; use jj_lib::op_store::WorkspaceId; use jj_lib::repo::ReadonlyRepo; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf; use jj_lib::repo_path::RepoPathComponent; @@ -48,11 +48,11 @@ use jj_lib::working_copy::CheckoutOptions; use jj_lib::working_copy::CheckoutStats; use jj_lib::working_copy::SnapshotOptions; use jj_lib::working_copy::UntrackedReason; -use jj_lib::working_copy::WorkingCopy; +use jj_lib::working_copy::WorkingCopy as _; use jj_lib::workspace::default_working_copy_factories; use jj_lib::workspace::LockedWorkspace; use jj_lib::workspace::Workspace; -use pollster::FutureExt; +use pollster::FutureExt as _; use test_case::test_case; use testutils::commit_with_tree; use testutils::create_tree; diff --git a/lib/tests/test_local_working_copy_concurrent.rs b/lib/tests/test_local_working_copy_concurrent.rs index 3110017cf..9bbfd7bf2 100644 --- a/lib/tests/test_local_working_copy_concurrent.rs +++ b/lib/tests/test_local_working_copy_concurrent.rs @@ -16,7 +16,7 @@ use std::cmp::max; use std::thread; use assert_matches::assert_matches; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf; use jj_lib::working_copy::CheckoutError; diff --git a/lib/tests/test_local_working_copy_sparse.rs b/lib/tests/test_local_working_copy_sparse.rs index 1cdce4cf0..c9bbaf523 100644 --- a/lib/tests/test_local_working_copy_sparse.rs +++ b/lib/tests/test_local_working_copy_sparse.rs @@ -13,15 +13,15 @@ // limitations under the License. use futures::StreamExt as _; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::local_working_copy::LocalWorkingCopy; use jj_lib::matchers::EverythingMatcher; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf; use jj_lib::working_copy::CheckoutOptions; use jj_lib::working_copy::CheckoutStats; -use jj_lib::working_copy::WorkingCopy; +use jj_lib::working_copy::WorkingCopy as _; use pollster::FutureExt as _; use testutils::commit_with_tree; use testutils::create_tree; diff --git a/lib/tests/test_merge_trees.rs b/lib/tests/test_merge_trees.rs index d11884abb..bb2bf9259 100644 --- a/lib/tests/test_merge_trees.rs +++ b/lib/tests/test_merge_trees.rs @@ -15,7 +15,7 @@ use jj_lib::backend::MergedTreeId; use jj_lib::backend::TreeValue; use jj_lib::merge::Merge; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::rewrite::rebase_commit; use testutils::create_tree; diff --git a/lib/tests/test_merged_tree.rs b/lib/tests/test_merged_tree.rs index 734b84fc8..4a77d66ec 100644 --- a/lib/tests/test_merged_tree.rs +++ b/lib/tests/test_merged_tree.rs @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use futures::StreamExt; -use itertools::Itertools; +use futures::StreamExt as _; +use itertools::Itertools as _; use jj_lib::backend::CommitId; use jj_lib::backend::CopyRecord; use jj_lib::backend::FileId; @@ -35,7 +35,7 @@ use jj_lib::merged_tree::MergedTreeBuilder; use jj_lib::merged_tree::TreeDiffEntry; use jj_lib::merged_tree::TreeDiffIterator; use jj_lib::merged_tree::TreeDiffStreamImpl; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf; use jj_lib::repo_path::RepoPathComponent; diff --git a/lib/tests/test_mut_repo.rs b/lib/tests/test_mut_repo.rs index 4dde6b01f..0dbfdb7b5 100644 --- a/lib/tests/test_mut_repo.rs +++ b/lib/tests/test_mut_repo.rs @@ -18,7 +18,7 @@ use jj_lib::op_store::RemoteRef; use jj_lib::op_store::RemoteRefState; use jj_lib::op_store::WorkspaceId; use jj_lib::refs::RemoteRefSymbol; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::rewrite::RebaseOptions; use maplit::hashset; use testutils::assert_rebased_onto; diff --git a/lib/tests/test_operations.rs b/lib/tests/test_operations.rs index 10b876e19..42b4b15bf 100644 --- a/lib/tests/test_operations.rs +++ b/lib/tests/test_operations.rs @@ -22,7 +22,7 @@ use itertools::Itertools as _; use jj_lib::backend::CommitId; use jj_lib::config::ConfigLayer; use jj_lib::config::ConfigSource; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_walk; use jj_lib::op_walk::OpsetEvaluationError; use jj_lib::op_walk::OpsetResolutionError; diff --git a/lib/tests/test_refs.rs b/lib/tests/test_refs.rs index 96d0f2c14..4bc99f8e3 100644 --- a/lib/tests/test_refs.rs +++ b/lib/tests/test_refs.rs @@ -15,7 +15,7 @@ use jj_lib::merge::Merge; use jj_lib::op_store::RefTarget; use jj_lib::refs::merge_ref_targets; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use testutils::CommitGraphBuilder; use testutils::TestWorkspace; diff --git a/lib/tests/test_revset.rs b/lib/tests/test_revset.rs index 4b199bb2c..61f6a9cfb 100644 --- a/lib/tests/test_revset.rs +++ b/lib/tests/test_revset.rs @@ -17,7 +17,7 @@ use std::path::Path; use assert_matches::assert_matches; use chrono::DateTime; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend::ChangeId; use jj_lib::backend::CommitId; use jj_lib::backend::MillisSinceEpoch; @@ -29,7 +29,7 @@ use jj_lib::git; use jj_lib::graph::reverse_graph; use jj_lib::graph::GraphEdge; use jj_lib::id_prefix::IdPrefixContext; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::op_store::RefTarget; use jj_lib::op_store::RemoteRef; use jj_lib::op_store::RemoteRefState; @@ -50,7 +50,7 @@ use jj_lib::revset::RevsetFilterPredicate; use jj_lib::revset::RevsetParseContext; use jj_lib::revset::RevsetResolutionError; use jj_lib::revset::RevsetWorkspaceContext; -use jj_lib::revset::SymbolResolver; +use jj_lib::revset::SymbolResolver as _; use jj_lib::revset::SymbolResolverExtension; use jj_lib::workspace::Workspace; use test_case::test_case; diff --git a/lib/tests/test_rewrite.rs b/lib/tests/test_rewrite.rs index 10a09e377..1c616821d 100644 --- a/lib/tests/test_rewrite.rs +++ b/lib/tests/test_rewrite.rs @@ -23,7 +23,7 @@ use jj_lib::op_store::RemoteRef; use jj_lib::op_store::RemoteRefState; use jj_lib::op_store::WorkspaceId; use jj_lib::refs::RemoteRefSymbol; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::rewrite::rebase_commit_with_options; use jj_lib::rewrite::restore_tree; diff --git a/lib/tests/test_rewrite_duplicate.rs b/lib/tests/test_rewrite_duplicate.rs index af95ea85f..815539fa0 100644 --- a/lib/tests/test_rewrite_duplicate.rs +++ b/lib/tests/test_rewrite_duplicate.rs @@ -14,7 +14,7 @@ use itertools::Itertools as _; use jj_lib::backend::CommitId; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::repo_path::RepoPath; use jj_lib::rewrite::duplicate_commits; use jj_lib::transaction::Transaction; diff --git a/lib/tests/test_rewrite_transform.rs b/lib/tests/test_rewrite_transform.rs index fc88dc6c3..2e59a1677 100644 --- a/lib/tests/test_rewrite_transform.rs +++ b/lib/tests/test_rewrite_transform.rs @@ -14,7 +14,7 @@ use std::collections::HashMap; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use maplit::hashset; use testutils::CommitGraphBuilder; use testutils::TestRepo; diff --git a/lib/tests/test_signing.rs b/lib/tests/test_signing.rs index a18c82c31..1c8604bdf 100644 --- a/lib/tests/test_signing.rs +++ b/lib/tests/test_signing.rs @@ -3,7 +3,7 @@ use jj_lib::backend::Signature; use jj_lib::backend::Timestamp; use jj_lib::config::ConfigLayer; use jj_lib::config::ConfigSource; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::settings::UserSettings; use jj_lib::signing::SigStatus; use jj_lib::signing::SignBehavior; diff --git a/lib/tests/test_ssh_signing.rs b/lib/tests/test_ssh_signing.rs index 83d75dba0..0cdc643d4 100644 --- a/lib/tests/test_ssh_signing.rs +++ b/lib/tests/test_ssh_signing.rs @@ -15,14 +15,14 @@ use std::fs; #[cfg(unix)] use std::fs::Permissions; -use std::io::Write; +use std::io::Write as _; #[cfg(unix)] -use std::os::unix::prelude::PermissionsExt; +use std::os::unix::prelude::PermissionsExt as _; use std::path::Path; use std::path::PathBuf; use jj_lib::signing::SigStatus; -use jj_lib::signing::SigningBackend; +use jj_lib::signing::SigningBackend as _; use jj_lib::ssh_signing::SshBackend; static PRIVATE_KEY: &str = r#"-----BEGIN OPENSSH PRIVATE KEY----- diff --git a/lib/tests/test_view.rs b/lib/tests/test_view.rs index 3da10d0c4..78243c31e 100644 --- a/lib/tests/test_view.rs +++ b/lib/tests/test_view.rs @@ -20,7 +20,7 @@ use jj_lib::op_store::RemoteRef; use jj_lib::op_store::RemoteRefState; use jj_lib::op_store::WorkspaceId; use jj_lib::refs::RemoteRefSymbol; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use maplit::btreemap; use maplit::hashset; use test_case::test_case; diff --git a/lib/tests/test_workspace.rs b/lib/tests/test_workspace.rs index 2b83df696..a304fe21c 100644 --- a/lib/tests/test_workspace.rs +++ b/lib/tests/test_workspace.rs @@ -16,7 +16,7 @@ use std::thread; use assert_matches::assert_matches; use jj_lib::op_store::WorkspaceId; -use jj_lib::repo::Repo; +use jj_lib::repo::Repo as _; use jj_lib::workspace::default_working_copy_factories; use jj_lib::workspace::default_working_copy_factory; use jj_lib::workspace::Workspace; diff --git a/lib/testutils/src/lib.rs b/lib/testutils/src/lib.rs index 7717fcfe1..852433f82 100644 --- a/lib/testutils/src/lib.rs +++ b/lib/testutils/src/lib.rs @@ -16,14 +16,14 @@ use std::collections::HashMap; use std::env; use std::fs; use std::fs::OpenOptions; -use std::io::Read; -use std::io::Write; +use std::io::Read as _; +use std::io::Write as _; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; use std::sync::Once; -use itertools::Itertools; +use itertools::Itertools as _; use jj_lib::backend; use jj_lib::backend::Backend; use jj_lib::backend::BackendInitError; @@ -43,7 +43,7 @@ use jj_lib::config::StackedConfig; use jj_lib::git_backend::GitBackend; use jj_lib::local_backend::LocalBackend; use jj_lib::merged_tree::MergedTree; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::repo::MutableRepo; use jj_lib::repo::ReadonlyRepo; use jj_lib::repo::Repo; @@ -64,7 +64,7 @@ use jj_lib::working_copy::SnapshotError; use jj_lib::working_copy::SnapshotOptions; use jj_lib::working_copy::SnapshotStats; use jj_lib::workspace::Workspace; -use pollster::FutureExt; +use pollster::FutureExt as _; use tempfile::TempDir; use crate::test_backend::TestBackendFactory; @@ -447,7 +447,7 @@ pub fn commit_with_tree(store: &Arc, tree_id: MergedTreeId) -> Commit { } pub fn dump_tree(store: &Arc, tree_id: &MergedTreeId) -> String { - use std::fmt::Write; + use std::fmt::Write as _; let mut buf = String::new(); writeln!( &mut buf, diff --git a/lib/testutils/src/test_backend.rs b/lib/testutils/src/test_backend.rs index fd309af44..1a6cb67d7 100644 --- a/lib/testutils/src/test_backend.rs +++ b/lib/testutils/src/test_backend.rs @@ -46,7 +46,7 @@ use jj_lib::backend::SymlinkId; use jj_lib::backend::Tree; use jj_lib::backend::TreeId; use jj_lib::index::Index; -use jj_lib::object_id::ObjectId; +use jj_lib::object_id::ObjectId as _; use jj_lib::repo_path::RepoPath; use jj_lib::repo_path::RepoPathBuf;