Add #[must_use] to is_condition tests

A continuation of #89718.
This commit is contained in:
John Kugelman
2021-10-11 21:15:57 -04:00
parent 7cc8c44871
commit 01b439e764
6 changed files with 47 additions and 0 deletions

View File

@@ -232,6 +232,7 @@ impl SocketAddr {
/// assert_eq!(socket.is_ipv4(), true);
/// assert_eq!(socket.is_ipv6(), false);
/// ```
#[must_use]
#[stable(feature = "sockaddr_checker", since = "1.16.0")]
#[rustc_const_unstable(feature = "const_socketaddr", issue = "82485")]
pub const fn is_ipv4(&self) -> bool {
@@ -253,6 +254,7 @@ impl SocketAddr {
/// assert_eq!(socket.is_ipv4(), false);
/// assert_eq!(socket.is_ipv6(), true);
/// ```
#[must_use]
#[stable(feature = "sockaddr_checker", since = "1.16.0")]
#[rustc_const_unstable(feature = "const_socketaddr", issue = "82485")]
pub const fn is_ipv6(&self) -> bool {