1
Fork 0

Add #[must_use] to remaining std functions (A-N)

This commit is contained in:
John Kugelman 2021-10-30 22:58:27 -04:00
parent e249ce6b23
commit e129d49f88
18 changed files with 68 additions and 14 deletions

View file

@ -1310,6 +1310,7 @@ pub struct Initializer(bool);
impl Initializer {
/// Returns a new `Initializer` which will zero out buffers.
#[unstable(feature = "read_initializer", issue = "42788")]
#[must_use]
#[inline]
pub fn zeroing() -> Initializer {
Initializer(true)
@ -1324,6 +1325,7 @@ impl Initializer {
/// the method accurately reflects the number of bytes that have been
/// written to the head of the buffer.
#[unstable(feature = "read_initializer", issue = "42788")]
#[must_use]
#[inline]
pub unsafe fn nop() -> Initializer {
Initializer(false)
@ -1331,6 +1333,7 @@ impl Initializer {
/// Indicates if a buffer should be initialized.
#[unstable(feature = "read_initializer", issue = "42788")]
#[must_use]
#[inline]
pub fn should_initialize(&self) -> bool {
self.0