diff --git a/src/lib.rs b/src/lib.rs index 8477b8a..3c4143e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,7 +35,7 @@ pub struct NonEmptyString(String); impl NonEmptyString { /// Attempts to create a new `NonEmptyString`. /// If the given `string` is empty, `Err` is returned, containing the original `String`, `Ok` otherwise. - pub fn new(string: String) -> Result { + pub const fn new(string: String) -> Result { if string.is_empty() { Err(string) } else {