Skip to content

Commit 701a7e6

Browse files
committed
Update to rust master
1 parent 1676b01 commit 701a7e6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl Error {
3030
::init();
3131
Error {
3232
raw: raw::git_error {
33-
message: unsafe { s.to_c_str().unwrap() as *mut _ },
33+
message: unsafe { s.to_c_str().into_inner() as *mut _ },
3434
klass: raw::GIT_ERROR as libc::c_int,
3535
}
3636
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ impl ObjectType {
299299
pub fn str(&self) -> &'static str {
300300
unsafe {
301301
let ptr = call!(raw::git_object_type2string(*self));
302-
str::raw::c_str_to_static_slice(ptr)
302+
mem::transmute::<&str, &'static str>(str::from_c_str(ptr))
303303
}
304304
}
305305

src/remote_callbacks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ extern fn sideband_progress_cb(str: *const libc::c_char,
198198
Some(ref mut c) => c,
199199
None => return 0,
200200
};
201-
let r = slice::raw::buf_as_slice(str as *const u8, len as uint, |buf| {
202-
(*callback)(buf)
203-
});
201+
let ptr = str as *const u8;
202+
let buf = slice::from_raw_buf(&ptr, len as uint);
203+
let r = (*callback)(buf);
204204
if r {0} else {-1}
205205
}
206206
}

0 commit comments

Comments
 (0)