pub fn generate_message(&self) -> String {
        let mut messages = vec![];

        messages.push(format!(
            "assertion failed{maybe_loc}",
            maybe_loc = match &self.location {
                None => format!(""),
                Some(loc) => format!(": {}", loc),
            }
        ));

        let longest_key_length = self
            .facts
            .iter()
            .flat_map(|fact| match fact {
                Fact::KeyValue { key, .. } => Some(key),
                Fact::Value { .. } => None,
                Fact::Splitter => None,
            })
            .map(|key| key.len())
            .max()
            .unwrap_or(0);

        for x in self.facts.iter() {
            match x {
                Fact::KeyValue { key, value } => messages.push(format!(
                    "{key:width$}: {value}",
                    key = key,
                    value = value,
                    width = longest_key_length
                )),
                Fact::Value { value } => messages.push(value.to_string()),
                Fact::Splitter => messages.push(String::from("---")),
            }
        }
        messages.join("\n")
    }
/// Generates an assertion message from the assertion result.
Generates an assertion message from the assertion result.
Generates an assertion message from the assertion result .
pub fn generate_message(&self) -> String {
        let mut messages = vec![];
        messages.push(format!(
            "assertion failed{maybe_loc}",
            maybe_loc = match &self.location {
                None => format!(""),
                Some(loc) => format!(": {}", loc),
            }
        ));
        let longest_key_length = self
            .facts
            .iter()
            .flat_map(|fact| match fact {
                Fact::KeyValue { key, .. } => Some(key),
                Fact::Value { .. } => None,
                Fact::Splitter => None,
            })
            .map(|key| key.len())
            .max()
            .unwrap_or(0);
        for x in self.facts.iter() {
            match x {
                Fact::KeyValue { key, value } => messages.push(format!(
                    "{key:width$}: {value}",
                    key = key,
                    value = value,
                    width = longest_key_length
                )),
                Fact::Value { value } => messages.push(value.to_string()),
                Fact::Splitter => messages.push(String::from("---")),
            }
        }
        messages.join("\n")
    }
pub fn generate_message ( & self ) -> String { let mut messages = vec ! [ ] ; messages . push ( format ! ( " " maybe_loc match self location { None format ( " " ) Some ( loc ) format ( " " loc ) } ) ) ; let longest_key_length = self . facts . iter ( ) . flat_map ( | fact | match fact { Fact :: KeyValue { key , .. } => Some ( key ) , Fact :: Value { .. } => None , Fact :: Splitter => None , } ) . map ( | key | key . len ( ) ) . max ( ) . unwrap_or ( 0 ) ; for x in self . facts . iter ( ) { match x { Fact :: KeyValue { key , value } => messages . push ( format ! ( " " key key value value width longest_key_length ) ) , Fact :: Value { value } => messages . push ( value . to_string ( ) ) , Fact :: Splitter => messages . push ( String :: from ( " " ) ) , } } messages . join ( " \n " ) }
Generates an assertion message from the assertion result.
Generates an assertion message from the assertion result .
&self