1use crate::io::SizeHint;
2
3#[doc(hidden)]
7#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
8impl<T> SizeHint for &mut T {
9 #[inline]
10 fn lower_bound(&self) -> usize {
11 SizeHint::lower_bound(*self)
12 }
13
14 #[inline]
15 fn upper_bound(&self) -> Option<usize> {
16 SizeHint::upper_bound(*self)
17 }
18}
19
20#[doc(hidden)]
24#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
25impl SizeHint for &[u8] {
26 #[inline]
27 fn lower_bound(&self) -> usize {
28 self.len()
29 }
30
31 #[inline]
32 fn upper_bound(&self) -> Option<usize> {
33 Some(self.len())
34 }
35}