std: merge str::raw::from_buf and str::raw::from_c_str

This commit is contained in:
Erick Tryzelaar
2013-08-04 14:08:20 -07:00
parent bd908d4c0e
commit 3629f702e9
3 changed files with 27 additions and 32 deletions

View File

@@ -93,7 +93,7 @@ pub fn fill_charp_buf(f: &fn(*mut c_char, size_t) -> bool) -> Option<~str> {
do buf.as_mut_buf |b, sz| {
if f(b, sz as size_t) {
unsafe {
Some(str::raw::from_buf(b as *u8))
Some(str::raw::from_c_str(b as *c_char))
}
} else {
None