Skip to content

Commit ad29820

Browse files
committed
refactor(gctx): move KeyOrIdex to key submodule
1 parent 8cffebd commit ad29820

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/cargo/util/context/key.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ impl fmt::Display for ConfigKey {
112112
}
113113
}
114114

115+
#[derive(Debug)]
116+
pub enum KeyOrIdx {
117+
Key(String),
118+
Idx(usize),
119+
}
120+
115121
pub(super) fn escape_key_part<'a>(part: &'a str) -> Cow<'a, str> {
116122
let ok = part.chars().all(|c| {
117123
matches!(c,

src/cargo/util/context/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ pub use value::{Definition, OptValue, Value};
112112

113113
mod key;
114114
pub use key::ConfigKey;
115+
use key::KeyOrIdx;
115116

116117
mod path;
117118
pub use path::{ConfigRelativePath, PathAndArgs};
@@ -2064,12 +2065,6 @@ impl GlobalContext {
20642065
}
20652066
}
20662067

2067-
#[derive(Debug)]
2068-
enum KeyOrIdx {
2069-
Key(String),
2070-
Idx(usize),
2071-
}
2072-
20732068
/// Similar to [`toml::Value`] but includes the source location where it is defined.
20742069
#[derive(Eq, PartialEq, Clone)]
20752070
pub enum ConfigValue {

0 commit comments

Comments
 (0)