citahub / cita_trie

Rust implementation of the Modified Patricia Tree (aka Trie).
Apache License 2.0
71 stars 28 forks source link

Change root.clone() -> mem::swap #41

Closed ava57r closed 5 years ago

yejiayu commented 5 years ago

I plan to use rc and refcell rewrite to avoid all clone.

ava57r commented 5 years ago

mem::swap fine works =). No?

yejiayu commented 5 years ago

https://github.com/cryptape/cita-trie/pull/18#discussion_r264109426

ava57r commented 5 years ago

String support error https://doc.rust-lang.org/std/string/struct.String.html function from_utf8 return error with bytes

pub struct FromUtf8Error {
    bytes: Vec<u8>,
    error: Utf8Error,
}

create type error with return Node.

pub struct TrieError {
    node: Node,
    error: Error,
}
yejiayu commented 5 years ago

@andreevlex I rewrote the entire library. #43