Skip to content

Commit 82fff67

Browse files
authored
chore: resolve macros/derived-traits from crates w/ scopes rather than globally (jdx#2198)
1 parent 6e21014 commit 82fff67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+244
-80
lines changed

src/cache.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ static KEY: Lazy<String> = Lazy::new(|| {
158158

159159
#[cfg(test)]
160160
mod tests {
161+
use pretty_assertions::assert_eq;
162+
161163
use super::*;
162164

163165
#[test]

src/cli/alias/get.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ static AFTER_LONG_HELP: &str = color_print::cstr!(
4141

4242
#[cfg(test)]
4343
mod tests {
44+
use insta::assert_snapshot;
45+
4446
use crate::test::reset;
4547

4648
#[test]

src/cli/args/env_var_arg.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ impl FromStr for EnvVarArg {
2626

2727
#[cfg(test)]
2828
mod tests {
29-
use super::EnvVarArg;
30-
use crate::test::reset;
29+
use pretty_assertions::assert_eq;
3130
use test_log::test;
3231

32+
use crate::test::reset;
33+
34+
use super::EnvVarArg;
35+
3336
#[test]
3437
fn valid_values() {
3538
reset();

src/cli/args/forge_arg.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ static FORGE_MAP: Lazy<HashMap<&'static str, ForgeArg>> = Lazy::new(|| {
9797

9898
#[cfg(test)]
9999
mod tests {
100+
use pretty_assertions::{assert_eq, assert_str_eq};
101+
100102
use super::*;
101103

102104
#[test]

src/cli/args/tool_arg.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::path::PathBuf;
33
use std::str::FromStr;
44

55
use console::style;
6+
use eyre::bail;
67
use regex::Regex;
78

89
use crate::cli::args::ForgeArg;
@@ -162,6 +163,8 @@ fn parse_input(s: &str) -> (&str, Option<&str>) {
162163

163164
#[cfg(test)]
164165
mod tests {
166+
use pretty_assertions::assert_eq;
167+
165168
use super::*;
166169

167170
#[test]

src/cli/asdf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ fn list_versions(config: &Config, args: &[String]) -> Result<()> {
7171

7272
#[cfg(test)]
7373
mod tests {
74+
use insta::assert_snapshot;
75+
7476
use crate::test::reset;
7577

7678
#[test]

src/cli/cache/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ impl Cache {
4343

4444
#[cfg(test)]
4545
mod tests {
46+
use pretty_assertions::assert_str_eq;
47+
4648
use crate::env;
4749

4850
#[test]

src/cli/completion.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use clap::builder::PossibleValue;
22
use clap::ValueEnum;
33
use eyre::Result;
4+
use strum::EnumString;
45

56
/// Generate shell completions
67
#[derive(Debug, clap::Args)]
@@ -73,7 +74,7 @@ static AFTER_LONG_HELP: &str = color_print::cstr!(
7374
"#
7475
);
7576

76-
#[derive(Debug, Clone, Copy, EnumString, Display)]
77+
#[derive(Debug, Clone, Copy, EnumString, strum::Display)]
7778
#[strum(serialize_all = "snake_case")]
7879
enum Shell {
7980
Bash,

src/cli/current.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use console::style;
2-
use eyre::Result;
2+
use eyre::{bail, Result};
33

44
use crate::cli::args::ForgeArg;
55
use crate::config::Config;
@@ -102,10 +102,10 @@ static AFTER_LONG_HELP: &str = color_print::cstr!(
102102
shfmt 3.6.0
103103
shellcheck 0.9.0
104104
node 20.0.0
105-
105+
106106
$ <bold>mise current node</bold>
107107
20.0.0
108-
108+
109109
# can output multiple versions
110110
$ <bold>mise current python</bold>
111111
3.11.0 3.10.0

src/cli/deactivate.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
use eyre::Result;
1+
use eyre::{eyre, Result};
2+
use indoc::formatdoc;
23

34
use crate::shell::get_shell;
45
use crate::ui::style;
@@ -49,6 +50,8 @@ static AFTER_LONG_HELP: &str = color_print::cstr!(
4950

5051
#[cfg(test)]
5152
mod tests {
53+
use insta::assert_snapshot;
54+
5255
use crate::config::Config;
5356
use crate::env;
5457
use crate::test::reset;

0 commit comments

Comments
 (0)