From b4ebec024d51f1f1824807fc7ad74f7cffc17f61 Mon Sep 17 00:00:00 2001 From: Artem Vorotnikov Date: Sun, 26 Jan 2020 02:55:57 +0300 Subject: [PATCH] uint: make zero const fn --- uint/src/uint.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uint/src/uint.rs b/uint/src/uint.rs index 64990bf5c..b15726b72 100644 --- a/uint/src/uint.rs +++ b/uint/src/uint.rs @@ -642,8 +642,8 @@ macro_rules! construct_uint { /// Zero (additive identity) of this type. #[inline] - pub fn zero() -> Self { - From::from(0u64) + pub const fn zero() -> Self { + Self([0; $n_words]) } /// One (multiplicative identity) of this type.