Skip to content

Commit 260a270

Browse files
committed
Move default to trait definition
1 parent 11c49f6 commit 260a270

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

library/std/src/io/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,9 @@ impl<R: Read + SizeHint> Iterator for Bytes<R> {
24812481

24822482
#[stable(feature = "bufreader_size_hint", since = "1.51.0")]
24832483
trait SizeHint {
2484-
fn lower_bound(&self) -> usize;
2484+
fn lower_bound(&self) -> usize {
2485+
0
2486+
}
24852487

24862488
fn upper_bound(&self) -> Option<usize> {
24872489
None
@@ -2493,11 +2495,7 @@ trait SizeHint {
24932495
}
24942496

24952497
#[stable(feature = "bufreader_size_hint", since = "1.51.0")]
2496-
impl<T> SizeHint for T {
2497-
fn lower_bound(&self) -> usize {
2498-
0
2499-
}
2500-
}
2498+
impl<T> SizeHint for T;
25012499

25022500
#[stable(feature = "bufreader_size_hint", since = "1.51.0")]
25032501
impl<T> SizeHint for BufReader<T> {

0 commit comments

Comments
 (0)