We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31b77ae commit 2dd3c44Copy full SHA for 2dd3c44
src/libstd/os.rs
@@ -87,9 +87,8 @@ pub fn getcwd() -> Path {
87
88
// FIXME: move these to str perhaps? #2620
89
90
-pub fn fill_charp_buf(f: &fn(*mut c_char, size_t) -> bool)
91
- -> Option<~str> {
92
- let mut buf = vec::from_elem(TMPBUF_SZ, 0u8 as c_char);
+pub fn fill_charp_buf(f: &fn(*mut c_char, size_t) -> bool) -> Option<~str> {
+ let mut buf = [0 as c_char, .. TMPBUF_SZ];
93
do buf.as_mut_buf |b, sz| {
94
if f(b, sz as size_t) {
95
unsafe {
0 commit comments