It just seems weird to me that transmuting to a raw::Slice<u8>, and then 
casting the data ptr to a *mut u8 when I need it is safer than just using the 
&’a mut [u8] directly.




But alas, I’ll fix it.




  - Clark

On Fri, Sep 5, 2014 at 2:55 AM, Kevin Ballard <ke...@sb.org> wrote:

> It's still undefined behavior to construct the &mut reference like that, even 
> if it's never actually mutated. I think you need to ditch &mut and start 
> using *mut instead.
> -Kevin
>> On Sep 4, 2014, at 11:55 PM, "Clark Gaebel" <cg.wowus...@gmail.com> wrote:
>> 
>> from_str is only used to construct read-only Iobufs, which do not support 
>> writing into the buffer. Also, if you modify the string, it should 
>> invalidate the Iobuf since the lifetime is bound to the borrowed reference 
>> of the string.
>> 
>>   - Clark
>> 
>> 
>>> On Thu, Sep 4, 2014 at 8:36 PM, Kevin Ballard <ke...@sb.org> wrote:
>>> <smime.p7s>
>> 
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to