diff --git a/io/src/lib.rs b/io/src/lib.rs index 08a6c089d..c0bda4c97 100644 --- a/io/src/lib.rs +++ b/io/src/lib.rs @@ -201,11 +201,11 @@ pub struct Cursor { impl> Cursor { /// Constructs a new `Cursor` by wrapping `inner`. #[inline] - pub fn new(inner: T) -> Self { Cursor { inner, pos: 0 } } + pub const fn new(inner: T) -> Self { Cursor { inner, pos: 0 } } /// Returns the position read up to thus far. #[inline] - pub fn position(&self) -> u64 { self.pos } + pub const fn position(&self) -> u64 { self.pos } /// Sets the internal position. /// @@ -226,7 +226,7 @@ impl> Cursor { /// /// This is the whole wrapped buffer, including the bytes already read. #[inline] - pub fn get_ref(&self) -> &T { &self.inner } + pub const fn get_ref(&self) -> &T { &self.inner } /// Returns a mutable reference to the inner buffer. ///