File tree Expand file tree Collapse file tree 2 files changed +12
-18
lines changed Expand file tree Collapse file tree 2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 03b8c8df0174967206d1d65c1ac311e205050e1c
5
+ refs/heads/try: be9129f556f8f43158ccac31dab50aa6b79115b6
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -183,7 +183,6 @@ fn from_chars(chs: [char]) -> str {
183
183
ret buf;
184
184
}
185
185
186
- // FIXME: not unsafe now
187
186
/*
188
187
Function: from_cstr
189
188
@@ -1371,35 +1370,30 @@ An unsafe buffer of bytes. Corresponds to a C char pointer.
1371
1370
*/
1372
1371
type sbuf = * u8 ;
1373
1372
1373
+ // Module: unsafe
1374
+ //
1375
+ // These functions may create invalid UTF-8 strings and eat your baby.
1374
1376
mod unsafe {
1375
1377
export
1376
1378
// UNSAFE
1377
1379
from_bytes,
1378
1380
from_byte;
1379
1381
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.
1388
1386
unsafe fn from_bytes ( v : [ const u8 ] ) -> str unsafe {
1389
1387
let vcopy: [ u8 ] = v + [ 0u8 ] ;
1390
1388
let scopy: str = :: unsafe:: reinterpret_cast ( vcopy) ;
1391
1389
:: unsafe:: leak ( vcopy) ;
1392
1390
ret scopy;
1393
1391
}
1394
1392
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.
1403
1397
unsafe fn from_byte ( u : u8 ) -> str { unsafe :: from_bytes ( [ u] ) }
1404
1398
}
1405
1399
You can’t perform that action at this time.
0 commit comments