ocpi-tariffs 0.55.0

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

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