ocpi-tariffs 0.46.1

OCPI tariff calculations
Documentation
use super::{Unversioned, Version, Versioned};

impl<V, U> Version<V, U>
where
    V: Versioned,
    U: Unversioned<Versioned = V>,
{
    /// Return the `Versioned` object if the `Version` is `Certain`.
    ///
    /// # Panics
    ///
    /// Will panic if the `Version` is `Uncertain`.
    pub fn unwrap_certain(self) -> V {
        match self {
            Version::Certain(v) => v,
            Version::Uncertain(_) => panic!("The version of the object is unknown"),
        }
    }
}