Skip to content

Commit

Permalink
Mark some methods const
Browse files Browse the repository at this point in the history
  • Loading branch information
Kmeakin committed Aug 1, 2023
1 parent ab297a4 commit 68cbcc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct Header {
impl<T> EcoVec<T> {
/// Create a new, empty vector.
#[inline]
pub fn new() -> Self {
pub const fn new() -> Self {
Self {
ptr: Self::dangling(),
len: 0,
Expand All @@ -137,13 +137,13 @@ impl<T> EcoVec<T> {

/// 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
}

Expand Down

0 comments on commit 68cbcc9

Please sign in to comment.