diff options
| author | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-03-01 20:21:55 +0100 |
|---|---|---|
| committer | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-03-01 22:30:18 +0100 |
| commit | 63c4065af00a61aef24153a1d3dde76013f433bb (patch) | |
| tree | 705c7f7c748b7dbe274c3906cc5c068520bf3b8d /src/libcore/str | |
| parent | 09130044ce7429beb95742afa7fd371960dbe607 (diff) | |
| download | rust-63c4065af00a61aef24153a1d3dde76013f433bb.tar.gz rust-63c4065af00a61aef24153a1d3dde76013f433bb.zip | |
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.
Diffstat (limited to 'src/libcore/str')
| -rw-r--r-- | src/libcore/str/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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] |
