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:
@@ -342,7 +342,7 @@ mod tests {
|
||||
let mut core = Core::new().expect("Tokio Core should be created with no errors");
|
||||
let mut buffer = vec![0u8; 2048];
|
||||
|
||||
let mut data_vec = data.as_bytes().to_vec();
|
||||
let mut data_vec = data.as_bytes().into_vec();
|
||||
data_vec.extend(b"\n");
|
||||
|
||||
let stream = TcpStream::connect(addr, &core.handle())
|
||||
@@ -353,7 +353,7 @@ mod tests {
|
||||
io::read(stream, &mut buffer)
|
||||
})
|
||||
.and_then(|(_, read_buf, len)| {
|
||||
future::ok(read_buf[0..len].to_vec())
|
||||
future::ok(read_buf[0..len].into_vec())
|
||||
});
|
||||
let result = core.run(stream).expect("Core should run with no errors");
|
||||
|
||||
@@ -454,7 +454,7 @@ mod tests {
|
||||
let mut auth_request =
|
||||
r#"{"jsonrpc": "2.0", "method": "mining.authorize", "params": ["miner1", ""], "id": 1}"#
|
||||
.as_bytes()
|
||||
.to_vec();
|
||||
.into_vec();
|
||||
auth_request.extend(b"\n");
|
||||
|
||||
let mut core = Core::new().expect("Tokio Core should be created with no errors");
|
||||
@@ -487,7 +487,7 @@ mod tests {
|
||||
})
|
||||
.and_then(|(_, read_buf, len)| {
|
||||
trace!(target: "stratum", "Received work from server");
|
||||
future::ok(read_buf[0..len].to_vec())
|
||||
future::ok(read_buf[0..len].into_vec())
|
||||
});
|
||||
let response = String::from_utf8(
|
||||
core.run(stream).expect("Core should run with no errors")
|
||||
|
||||
Reference in New Issue
Block a user