Skip to content

Commit c2f8cf9

Browse files
committed
libcore: Remove as_bytes_slice
1 parent 68704e4 commit c2f8cf9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/str.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export
2424

2525
// Reinterpretation
2626
as_bytes,
27+
as_bytes_slice,
2728
as_buf,
2829
as_c_str,
2930

@@ -1751,6 +1752,10 @@ pure fn as_bytes<T>(s: ~str, f: fn(~[u8]) -> T) -> T {
17511752
}
17521753
}
17531754

1755+
pure fn as_bytes_slice(s: &a/str) -> &a/[u8] {
1756+
unsafe { ::unsafe::reinterpret_cast(&s) }
1757+
}
1758+
17541759
/**
17551760
* Work with the byte buffer of a string as a null-terminated C string.
17561761
*

0 commit comments

Comments
 (0)