From 002a0382aa8ce6bcf155ab29a6a2d8438e9ad108 Mon Sep 17 00:00:00 2001 From: yancy Date: Mon, 5 May 2025 07:16:42 -0500 Subject: [PATCH] Mark function constant Allow this function to be called elsewhere in the codebase in const context. --- units/src/result.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units/src/result.rs b/units/src/result.rs index e3e82021c..a7d02e88d 100644 --- a/units/src/result.rs +++ b/units/src/result.rs @@ -203,7 +203,7 @@ pub struct NumOpError(MathOp); impl NumOpError { /// Creates a [`NumOpError`] caused by `op`. - pub(crate) fn while_doing(op: MathOp) -> Self { NumOpError(op) } + pub(crate) const fn while_doing(op: MathOp) -> Self { NumOpError(op) } /// Returns `true` if this operation error'ed due to overflow. pub fn is_overflow(self) -> bool { self.0.is_overflow() }