Upgrade elastic-array to 0.9.0
This is a huge change, which includes some changes to replace code that originally cloned to reuse allocations instead. The updated `elastic-array` crate renames its consuming `Vec`-conversion method to `into_vec`, which means that I can do a simple `sed -i 's/to_vec/into_vec/'` and then fix the compilation errors. This commit is probably a minor performance win and definitely a significant readability win.
This commit is contained in:
@@ -7,7 +7,7 @@ version = "0.2.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
[dependencies]
|
||||
elastic-array = "0.8"
|
||||
elastic-array = "0.9"
|
||||
ethcore-bigint = { path = "../bigint" }
|
||||
lazy_static = "0.2"
|
||||
rustc-serialize = "0.3"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -98,7 +98,7 @@ pub fn decode_list<T>(bytes: &[u8]) -> Vec<T> where T: Decodable {
|
||||
///
|
||||
/// fn main () {
|
||||
/// let animal = "cat";
|
||||
/// let out = rlp::encode(&animal).to_vec();
|
||||
/// let out = rlp::encode(&animal).into_vec();
|
||||
/// assert_eq!(out, vec![0x83, b'c', b'a', b't']);
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@@ -264,8 +264,8 @@ impl RlpStream {
|
||||
/// panic! if stream is not finished.
|
||||
pub fn out(self) -> Vec<u8> {
|
||||
match self.is_finished() {
|
||||
//true => self.encoder.out().to_vec(),
|
||||
true => self.buffer.to_vec(),
|
||||
//true => self.encoder.out().into_vec(),
|
||||
true => self.buffer.into_vec(),
|
||||
false => panic!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user