Skip to content
Myr

Markdown: split min and max into two columns

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

authored by sharkdp · committed by David Peter · parent 14be4a0 · Browse files · 1 file+10 added−10 removed
This commit

State

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

Diff stats

1 file+10 added−10 removed

  • other:+10 added−10 removed

1 file+10 added−10 removed

modified:src/hyperfine/export/markdown.rs+10 added-10 removed
35 unmodified lines
36}3738fn table_header(unit_short_name: String) -> String {39 format!(40 "| Command | Mean [{unit}] | Min…Max [{unit}] | Relative |\n|:---|---:|---:|---:|\n",40 "| Command | Mean [{unit}] | Min [{unit}] | Max [{unit}] | Relative |\n|:---|---:|---:|---:|---:|\n",41 unit = unit_short_name42 )43}44
10 unmodified lines
55 let rel_str = format!("{:.1}", entry.relative_speed);5657 dest.extend(58 format!(59 "| `{command}` | {mean} ± {stddev} | {min}…{max} | {rel} |\n",59 "| `{command}` | {mean} ± {stddev} | {min} | {max} | {rel} |\n",60 command = result.command.replace("|", "\\|"),61 mean = mean_str,62 stddev = stddev_str,63 min = min_str,
43 unmodified lines
107 let formatted = String::from_utf8(exporter.serialize(&timing_results, None).unwrap()).unwrap();108109 let formatted_expected = format!(110 "{}\111| `sleep 0.1` | 105.7 ± 1.6 | 102.3…108.0 | 1.0 |112| `sleep 2` | 2005.0 ± 2.0 | 2002.0…2008.0 | 19.0 |111| `sleep 0.1` | 105.7 ± 1.6 | 102.3 | 108.0 | 1.0 |112| `sleep 2` | 2005.0 ± 2.0 | 2002.0 | 2008.0 | 19.0 |113",114 table_header("ms".to_string())115 );116
35 unmodified lines
152 let formatted = String::from_utf8(exporter.serialize(&timing_results, None).unwrap()).unwrap();153154 let formatted_expected = format!(155 "{}\156| `sleep 2` | 2.005 ± 0.002 | 2.002…2.008 | 19.0 |157| `sleep 0.1` | 0.106 ± 0.002 | 0.102…0.108 | 1.0 |156| `sleep 2` | 2.005 ± 0.002 | 2.002 | 2.008 | 19.0 |157| `sleep 0.1` | 0.106 ± 0.002 | 0.102 | 0.108 | 1.0 |158",159 table_header("s".to_string())160 );161
39 unmodified lines
201 .unwrap();202203 let formatted_expected = format!(204 "{}\205| `sleep 0.1` | 0.106 ± 0.002 | 0.102…0.108 | 1.0 |206| `sleep 2` | 2.005 ± 0.002 | 2.002…2.008 | 19.0 |205| `sleep 0.1` | 0.106 ± 0.002 | 0.102 | 0.108 | 1.0 |206| `sleep 2` | 2.005 ± 0.002 | 2.002 | 2.008 | 19.0 |207",208 table_header("s".to_string())209 );210
40 unmodified lines
251 .unwrap();252253 let formatted_expected = format!(254 "{}\255| `sleep 2` | 2005.0 ± 2.0 | 2002.0…2008.0 | 19.0 |256| `sleep 0.1` | 105.7 ± 1.6 | 102.3…108.0 | 1.0 |255| `sleep 2` | 2005.0 ± 2.0 | 2002.0 | 2008.0 | 19.0 |256| `sleep 0.1` | 105.7 ± 1.6 | 102.3 | 108.0 | 1.0 |257",258 table_header("ms".to_string())259 );260
2 unmodified lines