-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stdlib) Add new
parse_bytes
function (#1198)
* Basic implementation for parse_bytes function * Support exabyte * Add base optional argument * change default base to 2 and update testcase * allow ambiguous unit * Add more examples and add VRL test * Add bench and fix clippy * Adopt parse-size crate * update comment * Add change log * Bump MSVC to 1.81 required by `parse-size` crate
- Loading branch information
Showing
8 changed files
with
321 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,6 +174,7 @@ owo-colors,https://github.com/jam1garner/owo-colors,MIT,jam1garner <8260240+jam1 | |
pad,https://github.com/ogham/rust-pad,MIT,Ben S <[email protected]> | ||
parking,https://github.com/smol-rs/parking,Apache-2.0 OR MIT,"Stjepan Glavina <[email protected]>, The Rust Project Developers" | ||
parking_lot,https://github.com/Amanieu/parking_lot,MIT OR Apache-2.0,Amanieu d'Antras <[email protected]> | ||
parse-size,https://github.com/kennytm/parse-size,MIT,kennytm <[email protected]> | ||
paste,https://github.com/dtolnay/paste,MIT OR Apache-2.0,David Tolnay <[email protected]> | ||
peeking_take_while,https://github.com/fitzgen/peeking_take_while,MIT OR Apache-2.0,Nick Fitzgerald <[email protected]> | ||
pest,https://github.com/pest-parser/pest,MIT OR Apache-2.0,Dragoș Tiselice <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added new `parse_bytes` function to parse given bytes string such as `1MiB` or `1TB` either in binary or decimal base. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# result: 1024.0 | ||
|
||
parse_bytes!("1KB", unit: "B") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.