MCPcopy Index your code
hub / github.com/RustPython/RustPython / promoted_nested

Method promoted_nested

crates/derive-impl/src/util.rs:536–547  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

534
535impl AttributeExt for Attribute {
536 fn promoted_nested(&self) -> Result<PunctuatedNestedMeta> {
537 let list = self.promoted_list().map_err(|mut e| {
538 let name = self.get_ident().unwrap().to_string();
539 e.combine(err_span!(
540 self,
541 r##"#[{name} = "..."] cannot be a name/value, you probably meant \
542 #[{name}(name = "...")]"##,
543 ));
544 e
545 })?;
546 Ok(list.nested)
547 }
548 fn ident_and_promoted_nested(&self) -> Result<(&Ident, PunctuatedNestedMeta)> {
549 Ok((self.get_ident().unwrap(), self.promoted_nested()?))
550 }

Callers 1

Calls 3

to_stringMethod · 0.80
unwrapMethod · 0.45
combineMethod · 0.45

Tested by

no test coverage detected