Rollup merge of #89786 - jkugelman:must-use-len-and-is_empty, r=joshtriplett

Add #[must_use] to len and is_empty

Parent issue: #89692

r? `@joshtriplett`
This commit is contained in:
Matthias Krüger
2021-10-31 13:20:05 +01:00
committed by GitHub
14 changed files with 60 additions and 40 deletions

View File

@@ -431,12 +431,14 @@ impl<'a> SocketAncillary<'a> {
}
/// Returns `true` if the ancillary data is empty.
#[must_use]
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
pub fn is_empty(&self) -> bool {
self.length == 0
}
/// Returns the number of used bytes.
#[must_use]
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
pub fn len(&self) -> usize {
self.length