diff options
| author | bors <bors@rust-lang.org> | 2013-08-16 06:02:14 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-16 06:02:14 -0700 |
| commit | 680eb71564ebba5e76ce1e1a8287b30042332cc5 (patch) | |
| tree | 4c800d08841b4dfb44ee869dfa3a24fcec5b00a1 /src/libstd/sys.rs | |
| parent | 8caf5176224be2d5fb43036a0d6eeecf749f6fe6 (diff) | |
| parent | 5ca4cdc7b8fb8b9c3fd1a6160db31ff2f4b5b957 (diff) | |
| download | rust-680eb71564ebba5e76ce1e1a8287b30042332cc5.tar.gz rust-680eb71564ebba5e76ce1e1a8287b30042332cc5.zip | |
auto merge of #8532 : kballard/rust/cstr-cleanup, r=erickt
Implement interior null checking in `.to_c_str()`, among other changes.
Diffstat (limited to 'src/libstd/sys.rs')
| -rw-r--r-- | src/libstd/sys.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/sys.rs b/src/libstd/sys.rs index 03e6412fcb8..bfb9bee7802 100644 --- a/src/libstd/sys.rs +++ b/src/libstd/sys.rs @@ -105,8 +105,8 @@ pub trait FailWithCause { impl FailWithCause for ~str { fn fail_with(cause: ~str, file: &'static str, line: uint) -> ! { - do cause.to_c_str().with_ref |msg_buf| { - do file.to_c_str().with_ref |file_buf| { + do cause.with_c_str |msg_buf| { + do file.with_c_str |file_buf| { begin_unwind_(msg_buf, file_buf, line as libc::size_t) } } @@ -115,8 +115,8 @@ impl FailWithCause for ~str { impl FailWithCause for &'static str { fn fail_with(cause: &'static str, file: &'static str, line: uint) -> ! { - do cause.to_c_str().with_ref |msg_buf| { - do file.to_c_str().with_ref |file_buf| { + do cause.with_c_str |msg_buf| { + do file.with_c_str |file_buf| { begin_unwind_(msg_buf, file_buf, line as libc::size_t) } } |
