Daniel Hofstetter
3fb2919945
Merge pull request #7657 from uutils/renovate/smallvec-1.x-lockfile
...
chore(deps): update rust crate smallvec to v1.15.0
2025-04-05 07:17:50 +02:00
Karl McDowall
c56489e2b3
cat: Performance improvement when printing line numbers
...
Add a simple class to manually maintain a string representation
of the line number for the `cat` application.
Maintaing this string is much faster than converting a `usize`
line-number variable to a string each time it's needed.
Gives a significant performance improvement with -n and -b
flags.
2025-04-04 19:50:05 -06:00
renovate[bot]
7764883d94
chore(deps): update rust crate smallvec to v1.15.0
2025-04-05 01:48:02 +00:00
karlmcdowall
e6ff6d5c69
cat: Formatting performance improvement ( #7642 )
...
* cat: Formatting performance improvement
Use memchr library in `cat` to improve performance when detecting
newlines.
Significantly improves performance when running with -n, -s, -E, -b
flags.
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
---------
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-04-04 23:47:28 +02:00
Sylvestre Ledru
88cf66174f
Merge pull request #7648 from drinkcat/parse_time-ebd
...
timeout: Use common parser to parse time duration
2025-04-04 23:46:48 +02:00
renovate[bot]
0d37927151
chore(deps): update rust crate zip to v2.6.1
2025-04-04 21:44:43 +00:00
Sylvestre Ledru
295628a2e9
Merge pull request #7631 from drinkcat/format-hex-default
...
uucore: format: Fix hexadecimal default format print
2025-04-04 23:44:35 +02:00
Sylvestre Ledru
be7b697341
Merge pull request #7654 from RenjiSann/uucore-cargo-toml
...
uucore: Minor fix to optional dependences
2025-04-04 23:43:25 +02:00
Dorian Peron
273a0500d8
uucore: remove clap dev dependency as it is already mentionned in regular dependencies
2025-04-04 18:53:35 +02:00
Dorian Peron
a3f770fbe8
uucore: make glob dependence optional under the parser feature
2025-04-04 18:53:35 +02:00
Dorian Peron
9dd8d8ab0d
uucore: make chrono, chrono-tz, iana-time-zone deps optional under the custom-tz-fmt feature
2025-04-04 18:53:35 +02:00
Nicolas Boichat
edc213d2c7
test_timeout: Add tests for very short timeouts
...
Note that unlike GNU coreutils, any value > 0 will not be treated
as 0, even if the exponent is very large.
2025-04-04 18:23:17 +02:00
Nicolas Boichat
3fc9c40c51
uucore: parser: parse_time: Use ExtendedBigDecimal parser
...
Gives a little bit more flexibility in terms of allowed input
for durations (e.g. in `timeout`), e.g. hex floating point
numbers are now allowed.
Fixes another part of #7475 .
2025-04-04 18:23:17 +02:00
Nicolas Boichat
1d7e0eccc8
uucore: parser: num_parser: Do not Underflow/Overflow when parsing 0
...
Values like 0e18172487393827593258 and 0e-18172487393827593258 should
just be parsed as 0, and do not need to return an error.
2025-04-04 18:12:11 +02:00
Nicolas Boichat
94a26e170e
uucore: parser: parse_time: Handle infinity and nan
...
There were some missing corner cases when handling infinity and
nan:
- inf/infinity can be capitalized
- nan must always be rejected, even if a suffix is provided
Also, return Duration::MAX with infinite values, just for consistency
(num.fract() returns 0 for infinity so technically we were just
short of that).
Add unit tests too.
Fixes some of #7475 .
2025-04-04 18:12:11 +02:00
Daniel Hofstetter
b860ce8553
Merge pull request #7650 from drinkcat/seq-trim-fix
...
seq: Trim whitespaces, then try to remove +
2025-04-04 17:57:09 +02:00
Nicolas Boichat
e0a6482759
seq: Trim whitespaces, then try to remove +
...
Otherwise, `seq` crashes with ` 0xee.` as input.
Also update one of the tests to catch that.
2025-04-04 17:09:33 +02:00
Daniel Hofstetter
bec2cb65b2
Merge pull request #7652 from uutils/renovate/ctrlc-3.x-lockfile
...
chore(deps): update rust crate ctrlc to v3.4.6
2025-04-04 17:01:55 +02:00
renovate[bot]
2564c5acf3
chore(deps): update rust crate ctrlc to v3.4.6
2025-04-04 14:24:20 +00:00
Daniel Hofstetter
22c7e1d0b6
Merge pull request #7647 from drinkcat/uucore-feature-parser
...
uucore: Move extendedbigdecimal and parsers to 2 separate features
2025-04-04 16:23:05 +02:00
Nicolas Boichat
6243dd5494
uucore: Move parser to a feature
...
This will eventually be needed as we'll want parse_time to
call into num_parser, which was previously contained in format
feature.
2025-04-04 15:25:06 +02:00
Nicolas Boichat
a937aa5117
uucore: Move extendedbigdecimal to its own feature
...
This will be needed later on so that we can split format and
parse features.
2025-04-04 14:12:51 +02:00
Sylvestre Ledru
97fb15b02d
Merge pull request #7646 from drinkcat/seq-w-f
...
seq: Do not allow -w and -f to be specified at the same time
2025-04-04 10:56:47 +02:00
Nicolas Boichat
ae3756b434
seq: Do not allow -w and -f to be specified at the same time
...
Fixes #7466 .
2025-04-04 10:17:17 +02:00
Daniel Hofstetter
d6cf38ff3f
Merge pull request #7644 from uutils/renovate/zip-2.x-lockfile
...
chore(deps): update rust crate zip to v2.6.0
2025-04-04 07:06:12 +02:00
renovate[bot]
e0078c169b
chore(deps): update rust crate zip to v2.6.0
2025-04-03 22:03:26 +00:00
Daniel Hofstetter
10a4dcb04d
Merge pull request #7624 from drinkcat/parse-bigdecimal-seq
...
seq: Move to uucore/format common number parsing code
2025-04-03 18:55:55 +02:00
Nicolas Boichat
04a12820bb
seq: Simplify leading + handling
...
Address review comment.
2025-04-03 17:26:38 +02:00
Nicolas Boichat
27efb9eff4
seq: Parse integral and fractional number of digits in the same function
...
A lot of the code can be shared, and parsing is quite straightforward
as we know that the digit is somewhat valid.
2025-04-03 17:26:38 +02:00
Nicolas Boichat
77d66bab47
seq: Refactor to actually use PreciseNumber::num_fractional_digits
...
The field was unused, and actually redundant with the precision
computed separatedly.
This simplifies the code, reintroduces testing.
2025-04-03 17:26:38 +02:00
Nicolas Boichat
84e5ee4b86
seq: Accept underflow in parameters
...
Also, add a test to check that a very, very, small number is
treated as 0. That's probably undefined behaviour, but it does
make some sense.
2025-04-03 17:26:38 +02:00
Nicolas Boichat
686f1c7841
seq: Remove custom number parsing
...
Just use the format provided function.
2025-04-03 17:26:38 +02:00
Nicolas Boichat
d58f1cc0f1
test_seq: Modify undefined behaviour tests
...
GNU `seq` doesn't support such large positive exponents anyway,
and we are limited by i64 range, so increase the exponent value
to make sure we fully overflow that range.
Also, add a test to check that a very, very, small number is
treated as 0 (that's also undefined behaviour, but it does
make sense in a way).
2025-04-03 17:26:38 +02:00
Sylvestre Ledru
2cfed639d3
Merge pull request #7640 from cakebaker/clippy_fix_warnings_from_rust_1_86
...
clippy: fix warnings from Rust 1.86
2025-04-03 16:38:07 +02:00
Daniel Hofstetter
293554e358
yes: fix error from manual_repeat_n lint
2025-04-03 15:38:06 +02:00
Daniel Hofstetter
5ab4968721
dd: fix "unused import" warning in test
2025-04-03 14:27:43 +02:00
Daniel Hofstetter
59d7866dcf
uutests: fix clippy errors
...
from doc_overindented_list_items lint
2025-04-03 14:25:51 +02:00
Daniel Hofstetter
a8a43f73b0
clippy: fix errors from unnecessary_semicolon lint
2025-04-03 14:24:16 +02:00
Daniel Hofstetter
7eb267ddcd
Merge pull request #7639 from uutils/renovate/blake3-1.x-lockfile
...
chore(deps): update rust crate blake3 to v1.8.1
2025-04-03 09:41:49 +02:00
Daniel Hofstetter
7af2c94678
Merge pull request #7636 from karlmcdowall/cat_find_a_bug_fix_a_bug
...
cat: bugfix when running with -T option
2025-04-03 09:35:09 +02:00
renovate[bot]
b6d94a9c9c
chore(deps): update rust crate blake3 to v1.8.1
2025-04-03 07:08:17 +00:00
Karl McDowall
a4b621ad8a
cat: bugfix when running with -T option
...
Fixes an crash seen when running with -T option if no newline
is found in a buffer.
Added unit test to validate.
2025-04-02 18:59:27 -06:00
Chandra Kiran G
3a0b43bdf7
df: add thiserror ( #7545 )
...
* refactor: Add thiserror to df
* fix: Try fixing tests
* refactor(df): Move `df` to `thiserror`
* chore(df): Add back comment
* chore: Refactor column.rs correctly
2025-04-02 10:19:19 +02:00
Daniel Hofstetter
dd5517c1ff
Merge pull request #7634 from uutils/sylvestre-patch-5
...
remaining-gnu-error.py: Adjust to the new URL
2025-04-02 07:34:25 +02:00
Sylvestre Ledru
0f4ea79229
remaining-gnu-error.py: Adjust to the new URL
2025-04-01 21:39:01 +02:00
Sylvestre Ledru
48cbcc44f4
Merge pull request #7628 from cakebaker/bump_iana_time_zone
...
Bump `iana-time-zone` & add `windows-core` to skip list
2025-04-01 21:30:32 +02:00
Sylvestre Ledru
cd4d75bfad
Merge pull request #7630 from cakebaker/bump_bigdecimal
...
Bump `bigdecimal` & fix failing test
2025-04-01 21:29:52 +02:00
Sylvestre Ledru
1071847198
Merge pull request #7633 from uutils/renovate/clap-4.x-lockfile
...
chore(deps): update rust crate clap to v4.5.35
2025-04-01 21:28:51 +02:00
renovate[bot]
642b739339
chore(deps): update rust crate clap to v4.5.35
2025-04-01 18:40:14 +00:00
Daniel Hofstetter
60ebace7f2
uucore/format: remove TODOs related to bigdecimal
2025-04-01 17:29:28 +02:00