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

Method ok_or_push

crates/derive-impl/src/util.rs:671–679  ·  view source on GitHub ↗
(&mut self, r: Result<T>)

Source from the content-addressed store, hash-verified

669 }
670
671 fn ok_or_push<T>(&mut self, r: Result<T>) -> Option<T> {
672 match r {
673 Ok(v) => Some(v),
674 Err(e) => {
675 self.push(e);
676 None
677 }
678 }
679 }
680}
681
682pub(crate) fn iter_use_idents<'a, F, R: 'a>(item_use: &'a syn::ItemUse, mut f: F) -> Result<Vec<R>>

Callers 3

impl_pymoduleFunction · 0.80
gen_module_itemMethod · 0.80

Calls 2

SomeClass · 0.50
pushMethod · 0.45

Tested by

no test coverage detected