Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
| @@ -1339,7 +1339,6 @@ fn test_stalled_value_stops(#[case] args: &[&str], #[case] expected: &str) { | |||
| #[case::comma_operands(&["0,25", "0,25", "1"], "0,25\n0,50\n0,75\n1,00\n")] | |||
| #[case::negative_comma_first(&["-,75", "1"], "-0,75\n0,25\n")] | |||
| #[case::negative_comma_increment(&["2", "-0,5", "1"], "2,0\n1,5\n1,0\n")] | |||
There was a problem hiding this comment.
could you please add cases for -w, -f %.3f and -f v%g. (the literal . must stay)? you checked them by hand, they should be in the test
|
|
||
| /// Like [`Self::fmt`], but writes `decimal_separator` in place of the `.` | ||
| /// of the formatted number. A `.` in the text around it is kept. | ||
| pub fn fmt_with_decimal_separator( |
There was a problem hiding this comment.
please add a unit test for this one in the tests module below
| if decimal_separator == "." { | ||
| return self.fmt(w, f); | ||
| } | ||
| let mut number = Vec::new(); |
There was a problem hiding this comment.
this allocates a Vec per number, could you reuse one buffer from the caller? seq calls it in a loop
|
Binary size comparison: |
Merging this PR will degrade performance by 1.55%3 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
…f and the uucore helper
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
In a locale whose decimal point is not
.,seqrejected operands such as0,25(invalid floating point argument) and-,75(taken for an option). It also printed0.25where GNU prints0,25.seqnow readsuucore::i18n::decimal::locale_decimal_separator()(enablingi18n-decimalfor it). An operand's locale separator is turned into.before parsing, and.is still accepted. Error messages show the operand as given.mark_first_operandtreats-followed by the separator as a number, soseq -,75 1works.Format::fmt_with_decimal_separatorin uucore. It replaces the.of the formatted number only, so a.in the text of a-fformat stays. With.as the separator it is the oldfmt, and the integer fast path is unchanged.This un-ignores
test_locale_decimal_point_operands, added in #16493. That test skips itself wherefr_FR.UTF-8isn't installed, which includes this Windows machine, so I also ran the binary withLC_ALL=fr_FR.UTF-8: the three cases give the expected0,25 0,50 0,75 1,00,-0,75 0,25and2,0 1,5 1,0;-w,-f %.3fand-f v%g.give0,5 … 2,0,1,000 …andv1,5.; the C locale is unchanged. Alltest_seqtests and the uucore format unit tests pass.Closes #16506
AI disclosure: written with help from Claude Code.