Skip to main content

alloc/io/
impls.rs

1use crate::boxed::Box;
2use crate::io::SizeHint;
3
4// =============================================================================
5// Forwarding implementations
6
7#[doc(hidden)]
8#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
9impl<T> SizeHint for Box<T> {
10    #[inline]
11    fn lower_bound(&self) -> usize {
12        SizeHint::lower_bound(&**self)
13    }
14
15    #[inline]
16    fn upper_bound(&self) -> Option<usize> {
17        SizeHint::upper_bound(&**self)
18    }
19}
20
21// =============================================================================
22// In-memory buffer implementations