These are chat archives for rust-lang/rust

30th
Sep 2015
Remi Rampin
@remram44
Sep 30 2015 01:04
You could call transmute, which is what you mean, and is the equivalent of a reinterpret_cast, but of course it's an unsafe function :)
Daniel Ferreira Monteiro Alves
@danfma
Sep 30 2015 05:03
hello guys!
how can I create a owned pointer in rust 1.3? Or something to replace it...
Daniel Ferreira Monteiro Alves
@danfma
Sep 30 2015 05:30
I found a way... I thought that any impl would be applied automatically on the type but you have to import it manually... So, after playing with Option<Box<T>> I can get the job done!
but I still think that should have a better way to this
match self.next {
    None => {
        self.next = Some(Node::new_boxed(value));
    },
    Some (ref mut boxed_node) => {
        let mut node = boxed_node.deref_mut();
        node.append(value);
    }
}