Skip to content

Commit 3358674

Browse files
committed
Move default to trait definition
1 parent edcd2ba commit 3358674

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
@@ -2478,7 +2478,9 @@ impl<R: Read + SizeHint> Iterator for Bytes<R> {
24782478

24792479
#[stable(feature = "bufreader_size_hint", since = "1.51.0")]
24802480
trait SizeHint {
2481-
fn lower_bound(&self) -> usize;
2481+
fn lower_bound(&self) -> usize {
2482+
0
2483+
}
24822484

24832485
fn upper_bound(&self) -> Option<usize> {
24842486
None
@@ -2490,11 +2492,7 @@ trait SizeHint {
24902492
}
24912493

24922494
#[stable(feature = "bufreader_size_hint", since = "1.51.0")]
2493-
impl<T> SizeHint for T {
2494-
fn lower_bound(&self) -> usize {
2495-
0
2496-
}
2497-
}
2495+
impl<T> SizeHint for T;
24982496

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

0 commit comments

Comments
 (0)