Mark function constant
Allow this function to be called elsewhere in the codebase in const context.
This commit is contained in:
parent
6737c3a0e5
commit
002a0382aa
|
@ -203,7 +203,7 @@ pub struct NumOpError(MathOp);
|
||||||
|
|
||||||
impl NumOpError {
|
impl NumOpError {
|
||||||
/// Creates a [`NumOpError`] caused by `op`.
|
/// 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.
|
/// Returns `true` if this operation error'ed due to overflow.
|
||||||
pub fn is_overflow(self) -> bool { self.0.is_overflow() }
|
pub fn is_overflow(self) -> bool { self.0.is_overflow() }
|
||||||
|
|
Loading…
Reference in New Issue