Skip to content
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

split: impl struct Suffix and add tests #313

Merged
merged 2 commits into from
Oct 13, 2024
Merged

Conversation

fox0
Copy link
Contributor

@fox0 fox0 commented Oct 11, 2024

Also returned assert!(false); in fn write()

Copy link
Contributor

@jgarzik jgarzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK except for small detail - panic message text

file/split.rs Outdated
@@ -152,7 +163,7 @@ impl OutputState {
fn write(&mut self, buf: &[u8]) -> io::Result<()> {
match &mut self.outf {
Some(ref mut f) => f.write_all(buf),
None => Ok(()),
None => panic!("lol"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, but need to do better.

Put a real error message there.

@jgarzik jgarzik merged commit 45fb86f into rustcoreutils:main Oct 13, 2024
2 checks passed
@@ -163,7 +163,8 @@ impl OutputState {
fn write(&mut self, buf: &[u8]) -> io::Result<()> {
match &mut self.outf {
Some(ref mut f) => f.write_all(buf),
None => panic!("lol"),
// TODO:
None => panic!("unreachable"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, you can use macro unreachable!()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants