Skip to content

split: impl struct Suffix and add tests#313

Merged
jgarzik merged 2 commits intorustcoreutils:mainfrom
fox0:split
Oct 13, 2024
Merged

split: impl struct Suffix and add tests#313
jgarzik merged 2 commits intorustcoreutils:mainfrom
fox0:split

Conversation

@fox0
Copy link
Copy Markdown
Contributor

@fox0 fox0 commented Oct 11, 2024

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

Copy link
Copy Markdown
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

Comment thread file/split.rs Outdated
match &mut self.outf {
Some(ref mut f) => f.write_all(buf),
None => Ok(()),
None => panic!("lol"),
Copy link
Copy Markdown
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
Comment thread file/split.rs
Some(ref mut f) => f.write_all(buf),
None => panic!("lol"),
// TODO:
None => panic!("unreachable"),
Copy link
Copy Markdown
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