mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-28 10:50:57 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4fb20f85b | ||
|
|
ecf8a24b1e | ||
|
|
975a25ce44 | ||
|
|
9cdb9c4c50 | ||
|
|
ba98c8c44b |
No files matched your search
@@ -18,7 +18,7 @@ jobs:
|
|||||||
name: Extract crate metadata
|
name: Extract crate metadata
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Extract crate information
|
- name: Extract crate information
|
||||||
id: crate_metadata
|
id: crate_metadata
|
||||||
run: |
|
run: |
|
||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- run: cargo fmt -- --check
|
- run: cargo fmt -- --check
|
||||||
|
|
||||||
min_version:
|
min_version:
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
needs: crate_metadata
|
needs: crate_metadata
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install rust toolchain (v${{ needs.crate_metadata.outputs.msrv }})
|
- name: Install rust toolchain (v${{ needs.crate_metadata.outputs.msrv }})
|
||||||
uses: dtolnay/rust-toolchain@master
|
uses: dtolnay/rust-toolchain@master
|
||||||
@@ -96,7 +96,7 @@ jobs:
|
|||||||
BUILD_CMD: cargo
|
BUILD_CMD: cargo
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install prerequisites
|
- name: Install prerequisites
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
+5
-3
@@ -19,6 +19,8 @@ impl Exporter for CsvExporter {
|
|||||||
_unit: Option<TimeUnit>,
|
_unit: Option<TimeUnit>,
|
||||||
_sort_order: SortOrder,
|
_sort_order: SortOrder,
|
||||||
) -> Result<Vec<u8>> {
|
) -> Result<Vec<u8>> {
|
||||||
|
const CSV_PRECISION: usize = 6;
|
||||||
|
|
||||||
let mut writer = WriterBuilder::new().from_writer(vec![]);
|
let mut writer = WriterBuilder::new().from_writer(vec![]);
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -48,7 +50,7 @@ impl Exporter for CsvExporter {
|
|||||||
res.min,
|
res.min,
|
||||||
res.max,
|
res.max,
|
||||||
] {
|
] {
|
||||||
fields.push(Cow::Owned(f.to_string().into_bytes()))
|
fields.push(Cow::Owned(format!("{f:.CSV_PRECISION$}").into_bytes()))
|
||||||
}
|
}
|
||||||
for v in res.parameters.values() {
|
for v in res.parameters.values() {
|
||||||
fields.push(Cow::Borrowed(v.as_bytes()))
|
fields.push(Cow::Borrowed(v.as_bytes()))
|
||||||
@@ -117,7 +119,7 @@ fn test_csv() {
|
|||||||
|
|
||||||
insta::assert_snapshot!(actual, @r#"
|
insta::assert_snapshot!(actual, @r#"
|
||||||
command,mean,stddev,median,user,system,min,max,parameter_bar,parameter_foo
|
command,mean,stddev,median,user,system,min,max,parameter_bar,parameter_foo
|
||||||
command_a,1,2,1,3,4,5,6,two,one
|
command_a,1.000000,2.000000,1.000000,3.000000,4.000000,5.000000,6.000000,two,one
|
||||||
command_b,11,12,11,13,14,15,16.5,seven,one
|
command_b,11.000000,12.000000,11.000000,13.000000,14.000000,15.000000,16.500000,seven,one
|
||||||
"#);
|
"#);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user