Skip to content

Commit

Permalink
Use just std::_ instead of ::std::_
Browse files Browse the repository at this point in the history
Accessing std this way has been stable since Rust 1.30.0
  • Loading branch information
faern authored and Gankra committed Apr 27, 2020
1 parent 8413980 commit 9f131b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/vec-deref.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl<T> Deref for Vec<T> {
type Target = [T];
fn deref(&self) -> &[T] {
unsafe {
::std::slice::from_raw_parts(self.ptr.as_ptr(), self.len)
std::slice::from_raw_parts(self.ptr.as_ptr(), self.len)
}
}
}
Expand All @@ -32,7 +32,7 @@ use std::ops::DerefMut;
impl<T> DerefMut for Vec<T> {
fn deref_mut(&mut self) -> &mut [T] {
unsafe {
::std::slice::from_raw_parts_mut(self.ptr.as_ptr(), self.len)
std::slice::from_raw_parts_mut(self.ptr.as_ptr(), self.len)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/vec-final.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ impl<T> Deref for Vec<T> {
type Target = [T];
fn deref(&self) -> &[T] {
unsafe {
::std::slice::from_raw_parts(self.ptr(), self.len)
std::slice::from_raw_parts(self.ptr(), self.len)
}
}
}

impl<T> DerefMut for Vec<T> {
fn deref_mut(&mut self) -> &mut [T] {
unsafe {
::std::slice::from_raw_parts_mut(self.ptr(), self.len)
std::slice::from_raw_parts_mut(self.ptr(), self.len)
}
}
}
Expand Down

0 comments on commit 9f131b5

Please sign in to comment.