Skip to content

Commit 1363353

Browse files
uefi: Make additional functions const
1 parent f7862d0 commit 1363353

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

uefi/src/data_types/owned_strs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ impl CString16 {
101101

102102
/// Returns the number of characters without the trailing null character.
103103
#[must_use]
104-
pub fn num_chars(&self) -> usize {
104+
pub const fn num_chars(&self) -> usize {
105105
self.0.len() - 1
106106
}
107107

108108
/// Returns if the string is empty. This ignores the null character.
109109
#[must_use]
110-
pub fn is_empty(&self) -> bool {
110+
pub const fn is_empty(&self) -> bool {
111111
self.num_chars() == 0
112112
}
113113
}

0 commit comments

Comments
 (0)