Format Rust Structure

[Solved] Format Rust Structure | Rust - Code Explorer | yomemimo.com
Question : format rust structure

Answered by : jeremy-damour

struct MyStruct { a: i32, b: i32
}
impl std::fmt::Display for MyStruct { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!(f, "(value a: {}, value b: {})", self.a, self.b) }
}

Source : | Last Update : Fri, 30 Sep 22

Answers related to format rust structure

Code Explorer Popular Question For Rust