Skip to content

Commit

Permalink
cleanup: remove redundant ::{self} from use declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Aug 23, 2024
1 parent 4ffd3a3 commit 87fb169
Show file tree
Hide file tree
Showing 39 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion cli/examples/custom-commit-templater/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ 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_parser;
use jj_cli::template_parser::TemplateParseError;
use jj_cli::template_parser::{self};
use jj_cli::templater::TemplatePropertyExt as _;
use jj_lib::backend::CommitId;
use jj_lib::commit::Commit;
Expand Down
2 changes: 1 addition & 1 deletion cli/examples/custom-operation-templater/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ 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_parser;
use jj_cli::template_parser::TemplateParseError;
use jj_cli::template_parser::{self};
use jj_cli::templater::TemplatePropertyExt as _;
use jj_lib::extensions_map::ExtensionsMap;
use jj_lib::object_id::ObjectId;
Expand Down
6 changes: 3 additions & 3 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ use core::fmt;
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::collections::HashSet;
use std::env;
use std::env::ArgsOs;
use std::env::VarError;
use std::env::{self};
use std::ffi::OsString;
use std::fmt::Debug;
use std::fs;
use std::io;
use std::io::Write as _;
use std::io::{self};
use std::mem;
use std::path::Path;
use std::path::PathBuf;
Expand Down Expand Up @@ -140,10 +140,10 @@ use crate::config::CommandNameAndArgs;
use crate::config::ConfigNamePathBuf;
use crate::config::ConfigSource;
use crate::config::LayeredConfigs;
use crate::diff_util;
use crate::diff_util::DiffFormat;
use crate::diff_util::DiffFormatArgs;
use crate::diff_util::DiffRenderer;
use crate::diff_util::{self};
use crate::formatter::FormatRecorder;
use crate::formatter::Formatter;
use crate::formatter::PlainTextFormatter;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ use criterion::BenchmarkId;
use criterion::Criterion;
use jj_lib::object_id::HexPrefix;
use jj_lib::repo::Repo;
use jj_lib::revset;
use jj_lib::revset::DefaultSymbolResolver;
use jj_lib::revset::RevsetExpression;
use jj_lib::revset::SymbolResolverExtension;
use jj_lib::revset::{self};

use crate::cli_util::CommandHelper;
use crate::cli_util::RevisionArg;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

use std::collections::HashMap;
use std::io;
use std::io::Read;
use std::io::{self};

use itertools::Itertools;
use jj_lib::commit::CommitIteratorExt;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/file/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::io;
use std::io::Write;
use std::io::{self};

use jj_lib::backend::BackendResult;
use jj_lib::conflicts::materialize_tree_value;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use jj_lib::backend::BackendError;
use jj_lib::backend::CommitId;
use jj_lib::backend::FileId;
use jj_lib::backend::TreeValue;
use jj_lib::fileset;
use jj_lib::fileset::FilesetExpression;
use jj_lib::fileset::{self};
use jj_lib::matchers::EverythingMatcher;
use jj_lib::matchers::Matcher;
use jj_lib::merged_tree::MergedTreeBuilder;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/git/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use std::io::Write;
use std::path::Path;
use std::path::PathBuf;

use jj_lib::git;
use jj_lib::git::GitFetchError;
use jj_lib::git::GitFetchStats;
use jj_lib::git::{self};
use jj_lib::repo::Repo;
use jj_lib::str_util::StringPattern;
use jj_lib::workspace::Workspace;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/git/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

use itertools::Itertools;
use jj_lib::git;
use jj_lib::git::GitFetchError;
use jj_lib::git::{self};
use jj_lib::repo::Repo;
use jj_lib::settings::ConfigResultExt as _;
use jj_lib::settings::UserSettings;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/git/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use std::io::Write;
use clap::ArgGroup;
use itertools::Itertools;
use jj_lib::backend::CommitId;
use jj_lib::git;
use jj_lib::git::GitBranchPushTargets;
use jj_lib::git::GitPushError;
use jj_lib::git::{self};
use jj_lib::object_id::ObjectId;
use jj_lib::op_store::RefTarget;
use jj_lib::refs::classify_branch_push_action;
Expand Down
10 changes: 5 additions & 5 deletions cli/src/commit_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use jj_lib::commit::Commit;
use jj_lib::copies::CopiesTreeDiffEntry;
use jj_lib::copies::CopyRecords;
use jj_lib::extensions_map::ExtensionsMap;
use jj_lib::fileset;
use jj_lib::fileset::FilesetExpression;
use jj_lib::fileset::{self};
use jj_lib::git;
use jj_lib::hex_util::to_reverse_hex;
use jj_lib::id_prefix::IdPrefixContext;
Expand All @@ -40,38 +40,38 @@ use jj_lib::op_store::RemoteRef;
use jj_lib::op_store::WorkspaceId;
use jj_lib::repo::Repo;
use jj_lib::repo_path::RepoPathUiConverter;
use jj_lib::revset;
use jj_lib::revset::Revset;
use jj_lib::revset::RevsetExpression;
use jj_lib::revset::RevsetModifier;
use jj_lib::revset::RevsetParseContext;
use jj_lib::revset::{self};
use jj_lib::store::Store;
use once_cell::unsync::OnceCell;

use crate::diff_util;
use crate::formatter::Formatter;
use crate::revset_util;
use crate::template_builder;
use crate::template_builder::merge_fn_map;
use crate::template_builder::BuildContext;
use crate::template_builder::CoreTemplateBuildFnTable;
use crate::template_builder::CoreTemplatePropertyKind;
use crate::template_builder::IntoTemplateProperty;
use crate::template_builder::TemplateBuildMethodFnMap;
use crate::template_builder::TemplateLanguage;
use crate::template_builder::{self};
use crate::template_parser;
use crate::template_parser::ExpressionNode;
use crate::template_parser::FunctionCallNode;
use crate::template_parser::TemplateParseError;
use crate::template_parser::TemplateParseResult;
use crate::template_parser::{self};
use crate::templater;
use crate::templater::PlainTextFormattedProperty;
use crate::templater::SizeHint;
use crate::templater::Template;
use crate::templater::TemplateFormatter;
use crate::templater::TemplateProperty;
use crate::templater::TemplatePropertyError;
use crate::templater::TemplatePropertyExt as _;
use crate::templater::{self};
use crate::text_util;

pub trait CommitTemplateLanguageExtension {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/diff_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ use unicode_width::UnicodeWidthStr as _;

use crate::config::CommandNameAndArgs;
use crate::formatter::Formatter;
use crate::merge_tools;
use crate::merge_tools::generate_diff;
use crate::merge_tools::invoke_external_diff;
use crate::merge_tools::new_utf8_temp_dir;
use crate::merge_tools::DiffGenerateError;
use crate::merge_tools::DiffToolMode;
use crate::merge_tools::ExternalMergeTool;
use crate::merge_tools::{self};
use crate::text_util;
use crate::ui::Ui;

Expand Down
4 changes: 2 additions & 2 deletions cli/src/generic_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

use std::collections::HashMap;

use crate::template_builder;
use crate::template_builder::BuildContext;
use crate::template_builder::CoreTemplateBuildFnTable;
use crate::template_builder::CoreTemplatePropertyKind;
use crate::template_builder::IntoTemplateProperty;
use crate::template_builder::TemplateLanguage;
use crate::template_builder::{self};
use crate::template_parser;
use crate::template_parser::FunctionCallNode;
use crate::template_parser::TemplateParseResult;
use crate::template_parser::{self};
use crate::templater::Template;
use crate::templater::TemplateProperty;

Expand Down
2 changes: 1 addition & 1 deletion cli/src/git_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ use std::process::Stdio;
use std::time::Instant;

use itertools::Itertools;
use jj_lib::git;
use jj_lib::git::FailedRefExport;
use jj_lib::git::FailedRefExportReason;
use jj_lib::git::GitImportStats;
use jj_lib::git::RefName;
use jj_lib::git::{self};
use jj_lib::git_backend::GitBackend;
use jj_lib::op_store::RefTarget;
use jj_lib::op_store::RemoteRef;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/merge_tools/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ use jj_lib::conflicts::materialize_tree_value;
use jj_lib::conflicts::MaterializedTreeValue;
use jj_lib::diff::Diff;
use jj_lib::diff::DiffHunk;
use jj_lib::files;
use jj_lib::files::ContentHunk;
use jj_lib::files::MergeResult;
use jj_lib::files::{self};
use jj_lib::matchers::Matcher;
use jj_lib::merge::Merge;
use jj_lib::merged_tree::MergedTree;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/merge_tools/diff_working_copies.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use std::fs::File;
use std::io;
use std::io::Write;
use std::io::{self};
use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc;
Expand Down
4 changes: 2 additions & 2 deletions cli/src/merge_tools/external.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;
use std::io;
use std::io::Write;
use std::io::{self};
use std::process::Command;
use std::process::ExitStatus;
use std::process::Stdio;
Expand All @@ -10,8 +10,8 @@ use itertools::Itertools;
use jj_lib::backend::FileId;
use jj_lib::backend::MergedTreeId;
use jj_lib::backend::TreeValue;
use jj_lib::conflicts;
use jj_lib::conflicts::materialize_merge_result;
use jj_lib::conflicts::{self};
use jj_lib::gitignore::GitIgnoreFile;
use jj_lib::matchers::Matcher;
use jj_lib::merge::Merge;
Expand Down
4 changes: 2 additions & 2 deletions cli/src/operation_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ use jj_lib::object_id::ObjectId;
use jj_lib::op_store::OperationId;
use jj_lib::operation::Operation;

use crate::template_builder;
use crate::template_builder::merge_fn_map;
use crate::template_builder::BuildContext;
use crate::template_builder::CoreTemplateBuildFnTable;
use crate::template_builder::CoreTemplatePropertyKind;
use crate::template_builder::IntoTemplateProperty;
use crate::template_builder::TemplateBuildMethodFnMap;
use crate::template_builder::TemplateLanguage;
use crate::template_builder::{self};
use crate::template_parser;
use crate::template_parser::FunctionCallNode;
use crate::template_parser::TemplateParseResult;
use crate::template_parser::{self};
use crate::templater::PlainTextFormattedProperty;
use crate::templater::Template;
use crate::templater::TemplateFormatter;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/revset_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use jj_lib::backend::CommitId;
use jj_lib::commit::Commit;
use jj_lib::id_prefix::IdPrefixContext;
use jj_lib::repo::Repo;
use jj_lib::revset;
use jj_lib::revset::DefaultSymbolResolver;
use jj_lib::revset::Revset;
use jj_lib::revset::RevsetAliasesMap;
Expand All @@ -35,7 +36,6 @@ use jj_lib::revset::RevsetParseContext;
use jj_lib::revset::RevsetParseError;
use jj_lib::revset::RevsetResolutionError;
use jj_lib::revset::SymbolResolverExtension;
use jj_lib::revset::{self};
use jj_lib::settings::ConfigResultExt as _;
use thiserror::Error;

Expand Down
4 changes: 2 additions & 2 deletions cli/src/template_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use jj_lib::backend::Signature;
use jj_lib::backend::Timestamp;
use jj_lib::dsl_util::AliasExpandError as _;

use crate::template_parser;
use crate::template_parser::BinaryOp;
use crate::template_parser::ExpressionKind;
use crate::template_parser::ExpressionNode;
Expand All @@ -28,7 +29,6 @@ use crate::template_parser::TemplateParseError;
use crate::template_parser::TemplateParseErrorKind;
use crate::template_parser::TemplateParseResult;
use crate::template_parser::UnaryOp;
use crate::template_parser::{self};
use crate::templater::CoalesceTemplate;
use crate::templater::ConcatTemplate;
use crate::templater::ConditionalTemplate;
Expand Down Expand Up @@ -1267,8 +1267,8 @@ mod tests {
use jj_lib::backend::MillisSinceEpoch;

use super::*;
use crate::formatter;
use crate::formatter::ColorFormatter;
use crate::formatter::{self};
use crate::generic_templater::GenericTemplateLanguage;

type L = GenericTemplateLanguage<'static, ()>;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/template_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::error;
use std::mem;

use itertools::Itertools as _;
use jj_lib::dsl_util;
use jj_lib::dsl_util::collect_similar;
use jj_lib::dsl_util::AliasDeclaration;
use jj_lib::dsl_util::AliasDeclarationParser;
Expand All @@ -29,7 +30,6 @@ use jj_lib::dsl_util::ExpressionFolder;
use jj_lib::dsl_util::FoldableExpression;
use jj_lib::dsl_util::InvalidArguments;
use jj_lib::dsl_util::StringLiteralParser;
use jj_lib::dsl_util::{self};
use once_cell::sync::Lazy;
use pest::iterators::Pair;
use pest::iterators::Pairs;
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/test_git_clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::path;
use std::path::Path;
use std::path::PathBuf;
use std::path::{self};

use crate::common::get_stderr_string;
use crate::common::get_stdout_string;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ use std::sync::Arc;

use itertools::Itertools;

use crate::backend;
use crate::backend::BackendResult;
use crate::backend::ChangeId;
use crate::backend::CommitId;
use crate::backend::MergedTreeId;
use crate::backend::Signature;
use crate::backend::{self};
use crate::merged_tree::MergedTree;
use crate::repo::Repo;
use crate::rewrite::merge_commit_trees;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/commit_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

use std::sync::Arc;

use crate::backend;
use crate::backend::BackendResult;
use crate::backend::ChangeId;
use crate::backend::CommitId;
use crate::backend::MergedTreeId;
use crate::backend::Signature;
use crate::backend::{self};
use crate::commit::Commit;
use crate::repo::MutableRepo;
use crate::repo::Repo;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/default_index/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ use crate::backend::BackendInitError;
use crate::backend::CommitId;
use crate::commit::CommitByCommitterTimestamp;
use crate::dag_walk;
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::file_util::{self};
use crate::index::Index;
use crate::index::IndexReadError;
use crate::index::IndexStore;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/file_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#![allow(missing_docs)]

use std::fs;
use std::fs::File;
use std::fs::{self};
use std::io;
use std::iter;
use std::path::Component;
Expand Down
Loading

0 comments on commit 87fb169

Please sign in to comment.