Skip to content

Commit

Permalink
Make iter::CharMutRefs::as_str_mut return a **mutable** string slice
Browse files Browse the repository at this point in the history
  • Loading branch information
tomBoddaert committed Oct 16, 2023
1 parent 08d1b11 commit 5ffa93a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mut-str"
version = "1.0.0"
version = "1.0.1"
authors = ["Tom Boddaert"]
edition = "2021"
description = "A toolkit for working with mutable string slices (&mut str)."
Expand Down
2 changes: 1 addition & 1 deletion lib/iter/cmrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<'a> CharMutRefs<'a> {
#[must_use]
#[inline]
/// Get the remaining mutable string to be iterated over.
pub fn as_str_mut<'b>(&'b mut self) -> &'b str {
pub fn as_str_mut<'b>(&'b mut self) -> &'b mut str {
// SAFETY:
// `self.s` is guaranteed to be the bytes of a valid utf8 string.
unsafe { str::from_utf8_unchecked_mut(self.s) }
Expand Down

0 comments on commit 5ffa93a

Please sign in to comment.