Skip to content

Commit 77d26df

Browse files
committed
Add some must_use to jemalloc-ctl key APIs
1 parent 562a530 commit 77d26df

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

jemalloc-ctl/src/keys.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ impl Name {
8888

8989
/// Returns `true` if `self` is a key in the _MALLCTL NAMESPCE_ referring to
9090
/// a null-terminated string.
91+
#[must_use]
9192
pub fn value_type_str(&self) -> bool {
9293
// remove the null-terminator:
9394
let name = self.0.split_at(self.0.len() - 1).0;
@@ -117,6 +118,7 @@ impl Name {
117118
}
118119

119120
/// Returns the name as null-terminated byte-string.
121+
#[must_use]
120122
pub fn as_bytes(&self) -> &'static [u8] {
121123
unsafe { &*(self as *const Self as *const [u8]) }
122124
}

jemalloc-ctl/src/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ macro_rules! types {
2727
}
2828

2929
/// Key [`::keys::Name`].
30+
#[must_use]
3031
pub fn name() -> &'static ::keys::Name {
3132
Self::NAME
3233
}

0 commit comments

Comments
 (0)