Add #[must_use]

This commit is contained in:
Stephen Chung
2021-06-12 22:47:43 +08:00
parent 68ea8c27fd
commit 8ca24059b1
28 changed files with 489 additions and 55 deletions

View File

@@ -17,6 +17,7 @@ const BUILTIN: &str = "never fails because this is built-in code and the type is
/// Is the type a numeric type?
#[inline(always)]
#[must_use]
fn is_numeric(type_id: TypeId) -> bool {
let result = type_id == TypeId::of::<u8>()
|| type_id == TypeId::of::<u16>()
@@ -40,6 +41,7 @@ fn is_numeric(type_id: TypeId) -> bool {
}
/// Build in common binary operator implementations to avoid the cost of calling a registered function.
#[must_use]
pub fn get_builtin_binary_op_fn(
op: &str,
x: &Dynamic,
@@ -425,6 +427,7 @@ pub fn get_builtin_binary_op_fn(
}
/// Build in common operator assignment implementations to avoid the cost of calling a registered function.
#[must_use]
pub fn get_builtin_op_assignment_fn(
op: &str,
x: &Dynamic,