Ok(())
}
}
-
-const DEFAULT_CONFIG: Config = Config {
- column_threshold: 2,
- static_columns: vec![],
-};
+impl Default for Config {
+ fn default() -> Self {
+ Self {
+ column_threshold: 2,
+ static_columns: vec![],
+ }
+ }
+}
const HEADER: &str = r#"<!DOCTYPE html>
<html>
}
fn read_input(input: impl std::io::Read) -> Result<(Vec<Rowlike>, Config), std::io::Error> {
- let mut config = DEFAULT_CONFIG;
+ let mut config = Config::default();
let reader = Reader::new(&mut config, std::io::BufReader::new(input).lines());
reader
.collect::<Result<Vec<_>, _>>()
fn test_render_row() {
assert_eq!(
render_row(
- &DEFAULT_CONFIG,
+ &Config::default(),
&["foo".to_owned()],
&mut Rowlike::Row(Row {
label: "nope".to_owned(),