diff --git a/benches/bench_log.rs b/benches/bench_log.rs index 67da760b..e6086895 100644 --- a/benches/bench_log.rs +++ b/benches/bench_log.rs @@ -662,11 +662,11 @@ fn bench_serializer_my_mem_writer1(b: &mut Bencher) { fn bench_copy(b: &mut Bencher) { let s = r#"{"timestamp":2837513946597,"zone_id":123456,"zone_plan":"FREE","http":{"protocol":"HTTP11","status":200,"host_status":503,"up_status":520,"method":"GET","content_type":"text/html","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36","referer":"https://www.cloudflare.com/","request_uri":"/cdn-cgi/trace"},"origin":{"ip":"1.2.3.4","port":8000,"hostname":"www.example.com","protocol":"HTTPS"},"country":"US","cache_status":"Hit","server_ip":"192.168.1.1","server_name":"metal.cloudflare.com","remote_ip":"10.1.2.3","bytes_dlv":123456,"ray_id":"10c73629cce30078-LAX"}"#; - let json = Vec::from_slice(s.as_bytes()); + let json = s.as_bytes().to_vec(); b.bytes = json.len() as u64; b.iter(|| { - let _json = Vec::from_slice(s.as_bytes()); + let _json = s.as_bytes().to_vec(); }); }