Skip to content

Commit 84f6fba

Browse files
committed
Directly forward non-paths in Override
1 parent 138c450 commit 84f6fba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/src/util/over_ride.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ impl<T: fmt::Display> fmt::Display for Override<T> {
137137
/// Parses a `Meta`. A bare word will produce `Override::Inherit`, while
138138
/// any value will be forwarded to `T::from_meta`.
139139
impl<T: FromMeta> FromMeta for Override<T> {
140+
fn from_meta(item: &syn::Meta) -> Result<Self> {
141+
match item {
142+
syn::Meta::Path(_) => Self::from_word(),
143+
_ => FromMeta::from_meta(item).map(Explicit),
144+
}
145+
}
146+
140147
fn from_word() -> Result<Self> {
141148
Ok(Inherit)
142149
}

0 commit comments

Comments
 (0)