Skip to content

Commit 0c0c156

Browse files
killerswanbrson
authored andcommitted
---
yaml --- r: 13932 b: refs/heads/try c: be9129f h: refs/heads/master v: v3
1 parent 6bf53aa commit 0c0c156

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 03b8c8df0174967206d1d65c1ac311e205050e1c
5+
refs/heads/try: be9129f556f8f43158ccac31dab50aa6b79115b6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libcore/str.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ fn from_chars(chs: [char]) -> str {
183183
ret buf;
184184
}
185185

186-
// FIXME: not unsafe now
187186
/*
188187
Function: from_cstr
189188
@@ -1371,35 +1370,30 @@ An unsafe buffer of bytes. Corresponds to a C char pointer.
13711370
*/
13721371
type sbuf = *u8;
13731372

1373+
// Module: unsafe
1374+
//
1375+
// These functions may create invalid UTF-8 strings and eat your baby.
13741376
mod unsafe {
13751377
export
13761378
// UNSAFE
13771379
from_bytes,
13781380
from_byte;
13791381

1380-
/*
1381-
Function: unsafe::from_bytes
1382-
1383-
Converts a vector of bytes to a string. Does not verify that the
1384-
vector contains valid UTF-8.
1385-
1386-
FIXME: stop exporting
1387-
*/
1382+
// Function: unsafe::from_bytes
1383+
//
1384+
// Converts a vector of bytes to a string. Does not verify that the
1385+
// vector contains valid UTF-8.
13881386
unsafe fn from_bytes(v: [const u8]) -> str unsafe {
13891387
let vcopy: [u8] = v + [0u8];
13901388
let scopy: str = ::unsafe::reinterpret_cast(vcopy);
13911389
::unsafe::leak(vcopy);
13921390
ret scopy;
13931391
}
13941392

1395-
/*
1396-
Function: unsafe::from_byte
1397-
1398-
Converts a byte to a string. Does not verify that the byte is
1399-
valid UTF-8.
1400-
1401-
FIXME: stop exporting
1402-
*/
1393+
// Function: unsafe::from_byte
1394+
//
1395+
// Converts a byte to a string. Does not verify that the byte is
1396+
// valid UTF-8.
14031397
unsafe fn from_byte(u: u8) -> str { unsafe::from_bytes([u]) }
14041398
}
14051399

0 commit comments

Comments
 (0)