Skip to content

Remove two warnings about unneccesary safe blocks. #6644

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/libstd/fileinput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ impl FileInput {
pub fn next_file(&self) -> bool {
// No more files

// unsafe block can be removed after the next snapshot
// (next one after 2013-05-03)
if unsafe { self.fi.files.is_empty() } {
if self.fi.files.is_empty() {
self.fi.current_reader = None;
return false;
}
Expand Down Expand Up @@ -324,9 +322,7 @@ impl io::Reader for FileInput {
fn eof(&self) -> bool {
// we've run out of files, and current_reader is either None or eof.

// unsafe block can be removed after the next snapshot
// (next one after 2013-05-03)
(unsafe { self.fi.files.is_empty() }) &&
self.fi.files.is_empty() &&
match self.fi.current_reader { None => true, Some(r) => r.eof() }

}
Expand Down