Skip to content
Myr

table_data => table_row

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent 7fdb32d · Browse files · 2 files+7 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−8 removed

  • other:+7 added−8 removed

2 files+7 added−8 removed

modified:src/export/markdown.rs+2 added-3 removed
2 unmodified lines
3#[derive(Default)]4pub struct MarkdownExporter {}56impl MarkupExporter for MarkdownExporter {7 fn table_data(&self, data: &[&str]) -> String {7 fn table_row(&self, data: &[&str]) -> String {8 format!("| {} |\n", data.join(" | "))9 }1011 fn table_line(&self, size: usize) -> String {
8 unmodified lines
20/// Check Markdown-based data row formatting21#[test]22fn test_markdown_formatter_table_data() {23 let formatter = MarkdownExporter::default();24 let data = vec!["a", "b", "c"];2426 let actual = formatter.table_data(&data);25 let actual = formatter.table_row(&["a", "b", "c"]);26 let expect = "| a | b | c |\n";2728 assert_eq!(expect, actual);29}
237 unmodified lines
modified:src/export/markup.rs+5 added-5 removed
17 unmodified lines
18 "Relative",19 ];2021 // emit header22 let mut table = self.table_data(&head);22 let mut table = self.table_row(&head);2324 // emit horizontal line25 table.push_str(&self.table_line(head.len()));26
16 unmodified lines
43 format!(" ± {:.2}", stddev)44 } else {45 "".into()46 };4748 // prepare table row entries48 let data: [&str; 5] = [49 table.push_str(&self.table_row(&[50 &self.command(&cmd_str),51 &format!("{}{}", mean_str, stddev_str),52 &min_str,53 &max_str,54 &format!("{}{}", rel_str, rel_stddev_str),54 ];55 table.push_str(&self.table_data(&data))55 ]))56 }5758 table59 }6061 fn table_data(&self, data: &[&str]) -> String;61 fn table_row(&self, data: &[&str]) -> String;6263 fn table_line(&self, size: usize) -> String;6465 fn command(&self, size: &str) -> String;
198 unmodified lines