-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract uucore::line_ending::LineEnding #5120
Conversation
Aims to provide consistent newline/zero terminator handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea! I just have some small suggestions.
Just so that the idea is out here (but not necessarily better), we could also make this a newtype around u8
:
struct LineEnding(u8);
const NEWLINE = ...;
const ZERO = ...;
I like the enum approach too though. Could you also run cargo fmt
?
Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
@tertsdiepraam, thank you for taking your time and reviewing my PR. Anything left to be done? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Just one last thing as far as I can see (and the CI might complain but we'll see how that goes).
Some small style warnings left, but otherwise ready to be merged! |
Hi, I'm back from vacation. Thanks for the pointer. I've fixed the remaining clippy warning. Hopefully everything is fine now. |
Nice! Now it's my turn to ask for your feedback. I've pushed a commit with a bit more documentation. Let me know if you agree with what I wrote! |
GNU testsuite comparison:
|
Great, thanks for taking care of the documentation. :-) |
bravo for this work :) |
* Extract uucore::line_ending::LineEnding Aims to provide consistent newline/zero terminator handling. * Apply suggestions from code review Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com> * cargo fmt * Use uucore::line_ending::LineEnding * Remove uucore::line_ending::LineEnding::Space * Rename LineEnding::from_zero_flag * Replace LineEnding::None with Option<LineEnding> * cargo clippy * assert_eq * cargo clippy * cargo clippy * uucore/line_ending: add more documentation --------- Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
Aims to provide consistent newline/zero terminator handling.