diff options
author | Dan Davison <dandavison7@gmail.com> | 2021-07-10 07:15:46 +0100 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2021-07-10 08:22:16 +0100 |
commit | 2826bdd75b31f42aac1c80b2302c25e739a8adf1 (patch) | |
tree | 702b1c1c511d210591bfcf1bd0b825e00c446822 /src | |
parent | a3fd4bb710bfbf96cae92d083555236ca131a09d (diff) |
Clippy: don't nest module inside module with same name
Diffstat (limited to 'src')
-rw-r--r-- | src/hunk_header.rs | 2 | ||||
-rw-r--r-- | src/tests/test_example_diffs.rs | 2 | ||||
-rw-r--r-- | src/tests/test_utils.rs | 26 |
3 files changed, 14 insertions, 16 deletions
diff --git a/src/hunk_header.rs b/src/hunk_header.rs index 5563030e..b72c1650 100644 --- a/src/hunk_header.rs +++ b/src/hunk_header.rs @@ -168,7 +168,7 @@ fn write_to_output_buffer( #[cfg(test)] pub mod tests { use super::*; - use crate::tests::integration_test_utils::integration_test_utils; + use crate::tests::integration_test_utils; #[test] fn test_get_painted_file_with_line_number_default() { diff --git a/src/tests/test_example_diffs.rs b/src/tests/test_example_diffs.rs index d9e32ae4..1a1d9991 100644 --- a/src/tests/test_example_diffs.rs +++ b/src/tests/test_example_diffs.rs @@ -6,7 +6,7 @@ mod tests { use crate::style; use crate::tests::ansi_test_utils::ansi_test_utils; use crate::tests::integration_test_utils; - use crate::tests::test_utils::test_utils; + use crate::tests::test_utils; #[test] fn test_added_file() { diff --git a/src/tests/test_utils.rs b/src/tests/test_utils.rs index 9f66adfa..3e17c839 100644 --- a/src/tests/test_utils.rs +++ b/src/tests/test_utils.rs @@ -1,24 +1,22 @@ -#[cfg(test)] -pub mod test_utils { - /// Return true iff `s` contains exactly one occurrence of substring `t`. - pub fn contains_once(s: &str, t: &str) -> bool { - match (s.find(t), s.rfind(t)) { - (Some(i), Some(j)) => i == j, - _ => false, - } +#![cfg(test)] +/// Return true iff `s` contains exactly one occurrence of substring `t`. +pub fn contains_once(s: &str, t: &str) -> bool { + match (s.find(t), s.rfind(t)) { + (Some(i), Some(j)) => i == j, + _ => false, } +} - #[allow(dead_code)] - pub fn print_with_line_numbers(s: &str) { - for (i, t) in s.lines().enumerate() { - println!("{:>2}│ {}", i + 1, t); - } +#[allow(dead_code)] +pub fn print_with_line_numbers(s: &str) { + for (i, t) in s.lines().enumerate() { + println!("{:>2}│ {}", i + 1, t); } } #[cfg(test)] mod tests { - use crate::tests::test_utils::test_utils::*; + use crate::tests::test_utils::*; #[test] fn test_contains_once_1() { |