We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 21034b3 + 9f57879 commit e80446cCopy full SHA for e80446c
src/array_string.rs
@@ -2,7 +2,6 @@ use std::borrow::Borrow;
2
use std::cmp;
3
use std::fmt;
4
use std::hash::{Hash, Hasher};
5
-use std::mem;
6
use std::ptr;
7
use std::ops::{Deref, DerefMut};
8
use std::str;
@@ -360,8 +359,7 @@ impl<A: Array<Item=u8>> DerefMut for ArrayString<A> {
360
359
fn deref_mut(&mut self) -> &mut str {
361
unsafe {
362
let sl = slice::from_raw_parts_mut(self.xs.as_mut_ptr(), self.len.to_usize());
363
- // FIXME: Nothing but transmute to do this right now
364
- mem::transmute(sl)
+ str::from_utf8_unchecked_mut(sl)
365
}
366
367
0 commit comments