Skip to content

Commit 5123b23

Browse files
committed
Add a comment mentioning that I/O errors are ignored.
1 parent c54fa28 commit 5123b23

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libstd/fs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ impl Read for File {
450450
}
451451

452452
fn size_snapshot(&self) -> Option<usize> {
453+
// Ignore I/O errors; we're just querying the size and position of an
454+
// already-open file in preparation for reading from it.
453455
if let Ok(meta) = self.metadata() {
454456
let len = meta.len();
455457
if let Ok(position) = self.inner.seek(SeekFrom::Current(0)) {

0 commit comments

Comments
 (0)