diff --git a/src/vec.rs b/src/vec.rs index 82ec2fb..ed2e2fb 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -111,7 +111,7 @@ struct Header { impl EcoVec { /// Create a new, empty vector. #[inline] - pub fn new() -> Self { + pub const fn new() -> Self { Self { ptr: Self::dangling(), len: 0, @@ -137,13 +137,13 @@ impl EcoVec { /// Returns `true` if the vector contains no elements. #[inline] - pub fn is_empty(&self) -> bool { + pub const fn is_empty(&self) -> bool { self.len == 0 } /// The number of elements in the vector. #[inline] - pub fn len(&self) -> usize { + pub const fn len(&self) -> usize { self.len }