MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / result_variant

Method result_variant

protocol/src/value.rs:801–810  ·  view source on GitHub ↗

# Panics Panic if self is not of `Result` variant, or variant is not "Ok" or "Err".

(&self)

Source from the content-addressed store, hash-verified

799 /// # Panics
800 /// Panic if self is not of `Result` variant, or variant is not "Ok" or "Err".
801 pub fn result_variant(&self) -> Result<(), ()> {
802 match self {
803 Self::Result { variant, .. } => match variant.as_str() {
804 "Ok" => Ok(()),
805 "Err" => Err(()),
806 e => panic!("Unexpected variant {e}"),
807 },
808 _ => panic!("Not Result"),
809 }
810 }
811}
812
813impl Display for PValue {

Callers 1

value_is_errorFunction · 0.80

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected