Skip to content

Commit a233b4c

Browse files
: config: global: robust to drop order in test overrides (meta-pytorch#1457)
Summary: Pull Request resolved: meta-pytorch#1457 Differential Revision: D84085259
1 parent 4d709e6 commit a233b4c

File tree

2 files changed

+287
-98
lines changed

2 files changed

+287
-98
lines changed

hyperactor/src/attrs.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ pub struct Key<T: 'static> {
153153
attrs: &'static LazyLock<Attrs>,
154154
}
155155

156+
impl<T> Key<T> {
157+
/// Returns the name of this key.
158+
pub fn name(&self) -> &'static str {
159+
self.name
160+
}
161+
}
162+
156163
impl<T: Named + 'static> Key<T> {
157164
/// Creates a new key with the given name.
158165
pub const fn new(
@@ -167,11 +174,6 @@ impl<T: Named + 'static> Key<T> {
167174
}
168175
}
169176

170-
/// Returns the name of this key.
171-
pub fn name(&self) -> &'static str {
172-
self.name
173-
}
174-
175177
/// Returns a reference to the default value for this key, if one exists.
176178
pub fn default(&self) -> Option<&'static T> {
177179
self.default_value

0 commit comments

Comments
 (0)