We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 194bbc7 commit aa74e93Copy full SHA for aa74e93
std/src/io/cursor.rs
@@ -153,7 +153,8 @@ impl<T> Cursor<T> {
153
/// let reference = buff.get_mut();
154
/// ```
155
#[stable(feature = "rust1", since = "1.0.0")]
156
- pub fn get_mut(&mut self) -> &mut T {
+ #[rustc_const_unstable(feature = "const_mut_cursor", issue = "130801")]
157
+ pub const fn get_mut(&mut self) -> &mut T {
158
&mut self.inner
159
}
160
@@ -200,7 +201,8 @@ impl<T> Cursor<T> {
200
201
/// assert_eq!(buff.position(), 4);
202
203
- pub fn set_position(&mut self, pos: u64) {
204
205
+ pub const fn set_position(&mut self, pos: u64) {
206
self.pos = pos;
207
208
0 commit comments