Skip to content

Commit

Permalink
chore: optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 14, 2024
1 parent 45caece commit 892184f
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/cli/args/cd_arg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use clap::{Arg, ArgAction};
use std::path::PathBuf;

use clap::{Arg, ArgAction};

#[derive(Clone)]
pub struct CdArg;

Expand Down
2 changes: 1 addition & 1 deletion src/cli/args/forge_arg.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::dirs;
use std::fmt::{Debug, Display};
use std::hash::Hash;
use std::path::PathBuf;

use crate::dirs;
use crate::forge::unalias_forge;
use crate::forge::ForgeType;

Expand Down
1 change: 1 addition & 0 deletions src/cli/direnv/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fn env_cmd() -> Expression {
#[cfg(test)]
mod tests {
use crate::cli::tests::grep;

#[test]
fn test_direnv_exec() {
let stdout = assert_cli!("direnv", "exec");
Expand Down
2 changes: 1 addition & 1 deletion src/cli/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ static AFTER_LONG_HELP: &str = color_print::cstr!(

#[cfg(test)]
mod tests {
use crate::cli::tests::grep;
use std::env;

use crate::cli::tests::grep;
use crate::dirs;

#[test]
Expand Down
1 change: 0 additions & 1 deletion src/cli/settings/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use eyre::Result;
use toml_edit::DocumentMut;

use crate::config::settings::SettingsFile;

use crate::{env, file};

/// Add/update a setting
Expand Down
3 changes: 2 additions & 1 deletion src/cli/usage.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::cli;
use clap::builder::Resettable;
use eyre::Result;

use crate::cli;

/// Generate a usage CLI spec
///
/// See https://usage.jdx.dev for more information
Expand Down
3 changes: 2 additions & 1 deletion src/default_shorthands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
// !GENERATED FILE!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

use once_cell::sync::Lazy;
use std::collections::{HashMap, HashSet};

use once_cell::sync::Lazy;

#[rustfmt::skip]
pub static DEFAULT_SHORTHANDS: Lazy<HashMap<&'static str, &'static str>> =
Lazy::new(|| HashMap::from([
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[macro_use]
extern crate contracts;
extern crate core;
#[macro_use]
extern crate eyre;
Expand All @@ -10,8 +12,6 @@ extern crate insta;
#[macro_use]
extern crate pretty_assertions;
#[macro_use]
extern crate contracts;
#[macro_use]
extern crate strum;

use std::process::exit;
Expand Down
2 changes: 1 addition & 1 deletion src/path_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use std::fmt;
use std::fmt::{Display, Formatter};
use std::path::PathBuf;

use crate::config::Settings;
use itertools::Itertools;

use crate::config::Settings;
use crate::dirs;

pub struct PathEnv {
Expand Down
1 change: 0 additions & 1 deletion src/plugins/core/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::ffi::OsString;

use std::sync::Arc;

use eyre::Result;
Expand Down
1 change: 0 additions & 1 deletion src/shell/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ impl Shell for Bash {

#[cfg(test)]
mod tests {

use crate::test::replace_path;

use super::*;
Expand Down
3 changes: 2 additions & 1 deletion src/shell/zsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ impl Shell for Zsh {

#[cfg(test)]
mod tests {
use super::*;
use crate::test::replace_path;

use super::*;

#[test]
fn test_activate() {
let zsh = Zsh::default();
Expand Down
10 changes: 6 additions & 4 deletions src/toolset/tool_request_set.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use std::collections::{BTreeMap, BTreeSet};
use std::fmt::{Debug, Display};

use indexmap::IndexMap;
use itertools::Itertools;

use crate::cli::args::{ForgeArg, ToolArg};
use crate::config::{Config, Settings};
use crate::toolset::{ToolRequest, ToolSource};
use crate::{config, env};
use indexmap::IndexMap;
use itertools::Itertools;
use std::collections::{BTreeMap, BTreeSet};
use std::fmt::{Debug, Display};

#[derive(Debug, Default, Clone)]
pub struct ToolRequestSet {
Expand Down
7 changes: 4 additions & 3 deletions src/ui/ctrlc.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use console::Term;
use signal_hook::consts::SIGINT;
use signal_hook::iterator::{Handle, Signals};
use std::process::exit;
use std::sync::atomic::{AtomicBool, Ordering};
use std::thread;

use console::Term;
use signal_hook::consts::SIGINT;
use signal_hook::iterator::{Handle, Signals};

#[must_use]
#[derive(Debug)]
pub struct HandleGuard(Handle);
Expand Down

0 comments on commit 892184f

Please sign in to comment.