From 63c4065af00a61aef24153a1d3dde76013f433bb Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Tue, 1 Mar 2016 20:21:55 +0100 Subject: Use raw pointer casts for slice, str's .as_ptr() We can now use raw pointer casts `*const [T] as *const T` and `*const str as *const u8` instead of .repr() for getting the pointer out of a slice. --- src/libcore/str/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcore/str') diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 4d367cfd432..a555b859291 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1894,7 +1894,7 @@ impl StrExt for str { #[inline] fn as_ptr(&self) -> *const u8 { - self.repr().data + self as *const str as *const u8 } #[inline] -- cgit 1.4.1-3-g733a5