cleanup: enable unused_trait_names clippy lint and run clippy --fix

This commit is contained in:
Ilya Grigoriev 2025-03-14 16:46:28 -07:00
parent 07d392ccf2
commit acaedc3382
161 changed files with 328 additions and 327 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 _;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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 _;

View File

@ -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 _;

View File

@ -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;

View File

@ -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::*;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)]

View File

@ -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...

View File

@ -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
///

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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;

View File

@ -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)]

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -16,7 +16,7 @@
use std::sync::Arc;
use pollster::FutureExt;
use pollster::FutureExt as _;
use crate::backend;
use crate::backend::BackendResult;

View File

@ -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;

View File

@ -23,7 +23,7 @@ pub trait ContentHash {
/// The 512-bit BLAKE2b content hash
pub fn blake2b_hash(x: &(impl ContentHash + ?Sized)) -> digest::Output<Blake2b512> {
use digest::Digest;
use digest::Digest as _;
let mut hasher = Blake2b512::default();
x.hash(&mut hasher);
hasher.finalize()

View File

@ -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;

View File

@ -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)]

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -210,7 +210,7 @@ mod platform {
#[cfg(test)]
mod tests {
use std::io::Write;
use std::io::Write as _;
use test_case::test_case;

Some files were not shown because too many files have changed in this diff Show More