pub fn to_commitment(self) -> Result<Commitment, VMError> {
        match self {
            Data::Opaque(data) => {
                let point = SliceReader::parse(&data, |r| r.read_point())?;
                Ok(Commitment::Closed(point))
            }
            Data::Commitment(c) => Ok(*c),
            _ => Err(VMError::TypeNotCommitment),
        }
    }
/// Downcast the data item to a `Commitment` type.
Downcast the data item to a `Commitment` type.
Downcast the data item to a ` Commitment ` type .
pub fn to_commitment(self) -> Result<Commitment, VMError> {
        match self {
            Data::Opaque(data) => {
                let point = SliceReader::parse(&data, |r| r.read_point())?;
                Ok(Commitment::Closed(point))
            }
            Data::Commitment(c) => Ok(*c),
            _ => Err(VMError::TypeNotCommitment),
        }
    }
pub fn to_commitment ( self ) -> Result < Commitment , VMError > { match self { Data :: Opaque ( data ) => { let point = SliceReader :: parse ( & data , | r | r . read_point ( ) ) ? ; Ok ( Commitment :: Closed ( point ) ) } Data :: Commitment ( c ) => Ok ( * c ) , _ => Err ( VMError :: TypeNotCommitment ) , } }
Downcast the data item to a `Commitment` type.
Downcast the data item to a ` Commitment ` type .
self
self