Uh oh!
There was an error while loading. Please reload this page.
Cleanup strs - #7996
Conversation
There was a problem hiding this comment.
This should probably have a warning about maintaining the invariant that the string is valid UTF8, and should definitely take &mut self rather than &self.
There was a problem hiding this comment.
Thanks for catching that. I'll add the &mut self and a warning.
erickt
commented
Jul 23, 2013
@huonw: Updated the pull request address your suggestion, and also added a couple more cleanup functions. |
graydon
commented
Jul 23, 2013
I would think (The whole matter of null termination remains, to this day, contentious. As you know, in #7235) |
erickt
commented
Jul 23, 2013
These uses are assuming the strings are null terminated, so it should be using `as_c_str` instead of `as_buf`
This eliminates a copy and fixes a FIXME.
erickt
commented
Jul 24, 2013
@graydon: Updated the pull request to add |
This is a cleanup pull request that does: * removes `os::as_c_charp` * moves `str::as_buf` and `str::as_c_str` into `StrSlice` * converts some functions from `StrSlice::as_buf` to `StrSlice::as_c_str` * renames `StrSlice::as_buf` to `StrSlice::as_imm_buf` (and adds `StrSlice::as_mut_buf` to match `vec.rs`. * renames `UniqueStr::as_bytes_with_null_consume` to `UniqueStr::to_bytes` * and other misc cleanups and minor optimizations
…arth Add test case for RESULT_MAP_OR_INTO_OPTION just added test case for RESULT_MAP_OR_INTO_OPTION. changelog: none
7996: Separate `Ty` and `TyKind` like in Chalk r=flodiebold a=flodiebold Currently `Ty` just wraps `TyKind`, but this allows us to change most places to already use `intern` / `interned`. Co-authored-by: Florian Diebold <flodiebold@gmail.com>
This is a cleanup pull request that does:
os::as_c_charpstr::as_bufandstr::as_c_strintoStrSliceStrSlice::as_buftoStrSlice::as_c_strStrSlice::as_buftoStrSlice::as_imm_buf(and addsStrSlice::as_mut_bufto matchvec.rs.UniqueStr::as_bytes_with_null_consumetoUniqueStr::to_bytes