diff options
| author | Xavientois <joshua.rampersad@hotmail.com> | 2021-01-15 17:47:25 -0500 |
|---|---|---|
| committer | Xavientois <joshua.rampersad@hotmail.com> | 2021-01-31 08:31:34 -0500 |
| commit | 260a270f7c531a3b8f951b69c9e793e3afd67c89 (patch) | |
| tree | b76194aca0447cef77624a766ce9aa81ab760a3a | |
| parent | 11c49f6a2a6cc7aa5b0223c4d2ec59fb4fc9b739 (diff) | |
| download | rust-260a270f7c531a3b8f951b69c9e793e3afd67c89.tar.gz rust-260a270f7c531a3b8f951b69c9e793e3afd67c89.zip | |
Move default to trait definition
| -rw-r--r-- | library/std/src/io/mod.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index ae019723394..cd54b8cc569 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -2481,7 +2481,9 @@ impl<R: Read + SizeHint> Iterator for Bytes<R> { #[stable(feature = "bufreader_size_hint", since = "1.51.0")] trait SizeHint { - fn lower_bound(&self) -> usize; + fn lower_bound(&self) -> usize { + 0 + } fn upper_bound(&self) -> Option<usize> { None @@ -2493,11 +2495,7 @@ trait SizeHint { } #[stable(feature = "bufreader_size_hint", since = "1.51.0")] -impl<T> SizeHint for T { - fn lower_bound(&self) -> usize { - 0 - } -} +impl<T> SizeHint for T; #[stable(feature = "bufreader_size_hint", since = "1.51.0")] impl<T> SizeHint for BufReader<T> { |
