|
1 | 1 | #[cfg(test)] |
2 | 2 | mod mutable_value { |
3 | | - use git_config::file::GitConfig; |
4 | 3 | use std::convert::TryFrom; |
5 | 4 |
|
| 5 | + use git_config::file::GitConfig; |
| 6 | + |
6 | 7 | fn init_config() -> GitConfig<'static> { |
7 | 8 | GitConfig::try_from( |
8 | 9 | r#"[core] |
|
137 | 138 |
|
138 | 139 | #[cfg(test)] |
139 | 140 | mod mutable_multi_value { |
140 | | - use git_config::file::GitConfig; |
141 | 141 | use std::{borrow::Cow, convert::TryFrom}; |
142 | 142 |
|
| 143 | + use git_config::file::GitConfig; |
| 144 | + |
143 | 145 | fn init_config() -> GitConfig<'static> { |
144 | 146 | GitConfig::try_from( |
145 | 147 | r#"[core] |
@@ -277,13 +279,12 @@ a"#, |
277 | 279 |
|
278 | 280 | #[cfg(test)] |
279 | 281 | mod from_paths_tests { |
280 | | - use std::borrow::Cow; |
281 | | - use std::path::Path; |
282 | | - use std::{fs, io}; |
| 282 | + use std::{borrow::Cow, fs, io, path::Path}; |
283 | 283 |
|
284 | | - use git_config::file::from_paths::Error; |
285 | | - use git_config::file::{from_paths, GitConfig}; |
286 | | - use git_config::parser::ParserOrIoError; |
| 284 | + use git_config::{ |
| 285 | + file::{from_paths, from_paths::Error, GitConfig}, |
| 286 | + parser::ParserOrIoError, |
| 287 | + }; |
287 | 288 | use tempfile::tempdir; |
288 | 289 |
|
289 | 290 | /// Escapes backslash when writing a path as string so that it is a valid windows path |
@@ -749,12 +750,9 @@ mod from_paths_tests { |
749 | 750 |
|
750 | 751 | #[cfg(test)] |
751 | 752 | mod from_env_tests { |
752 | | - use std::borrow::Cow; |
753 | | - use std::{env, fs}; |
| 753 | + use std::{borrow::Cow, env, fs}; |
754 | 754 |
|
755 | | - use git_config::file::from_paths::Options; |
756 | | - use git_config::file::GitConfig; |
757 | | - use git_config::file::{from_env, from_paths}; |
| 755 | + use git_config::file::{from_env, from_paths, from_paths::Options, GitConfig}; |
758 | 756 | use serial_test::serial; |
759 | 757 | use tempfile::tempdir; |
760 | 758 |
|
@@ -892,10 +890,12 @@ mod from_env_tests { |
892 | 890 |
|
893 | 891 | #[cfg(test)] |
894 | 892 | mod get_raw_value { |
895 | | - use git_config::file::{GitConfig, GitConfigError}; |
896 | | - use git_config::parser::SectionHeaderName; |
897 | | - use std::borrow::Cow; |
898 | | - use std::convert::TryFrom; |
| 893 | + use std::{borrow::Cow, convert::TryFrom}; |
| 894 | + |
| 895 | + use git_config::{ |
| 896 | + file::{GitConfig, GitConfigError}, |
| 897 | + parser::SectionHeaderName, |
| 898 | + }; |
899 | 899 |
|
900 | 900 | #[test] |
901 | 901 | fn single_section() { |
@@ -956,11 +956,12 @@ mod get_raw_value { |
956 | 956 |
|
957 | 957 | #[cfg(test)] |
958 | 958 | mod get_value { |
959 | | - use git_config::file::GitConfig; |
960 | | - use git_config::values::{Boolean, Bytes, TrueVariant}; |
961 | | - use std::borrow::Cow; |
962 | | - use std::convert::TryFrom; |
963 | | - use std::error::Error; |
| 959 | + use std::{borrow::Cow, convert::TryFrom, error::Error}; |
| 960 | + |
| 961 | + use git_config::{ |
| 962 | + file::GitConfig, |
| 963 | + values::{Boolean, Bytes, TrueVariant}, |
| 964 | + }; |
964 | 965 |
|
965 | 966 | #[test] |
966 | 967 | fn single_section() -> Result<(), Box<dyn Error>> { |
@@ -1005,10 +1006,12 @@ mod get_value { |
1005 | 1006 |
|
1006 | 1007 | #[cfg(test)] |
1007 | 1008 | mod get_raw_multi_value { |
1008 | | - use git_config::file::{GitConfig, GitConfigError}; |
1009 | | - use git_config::parser::SectionHeaderName; |
1010 | | - use std::borrow::Cow; |
1011 | | - use std::convert::TryFrom; |
| 1009 | + use std::{borrow::Cow, convert::TryFrom}; |
| 1010 | + |
| 1011 | + use git_config::{ |
| 1012 | + file::{GitConfig, GitConfigError}, |
| 1013 | + parser::SectionHeaderName, |
| 1014 | + }; |
1012 | 1015 |
|
1013 | 1016 | #[test] |
1014 | 1017 | fn single_value_is_identical_to_single_value_query() { |
@@ -1089,9 +1092,10 @@ mod get_raw_multi_value { |
1089 | 1092 |
|
1090 | 1093 | #[cfg(test)] |
1091 | 1094 | mod display { |
1092 | | - use git_config::file::GitConfig; |
1093 | 1095 | use std::convert::TryFrom; |
1094 | 1096 |
|
| 1097 | + use git_config::file::GitConfig; |
| 1098 | + |
1095 | 1099 | #[test] |
1096 | 1100 | fn can_reconstruct_empty_config() { |
1097 | 1101 | let config = r#" |
|
0 commit comments