http protocol: rename methods for writing to and parsing from bytes

This commit is contained in:
Joakim Frostegård 2024-01-29 19:52:41 +01:00
parent 3c906f48ee
commit 38de05a6c4
7 changed files with 30 additions and 30 deletions

View file

@ -33,7 +33,7 @@ pub fn bench(c: &mut Criterion) {
b.iter(|| {
buffer.set_position(0);
Response::write(black_box(&response), black_box(&mut buffer)).unwrap();
Response::write_bytes(black_box(&response), black_box(&mut buffer)).unwrap();
})
});
}

View file

@ -7,7 +7,7 @@ static INPUT: &[u8] = b"GET /announce?info_hash=%04%0bkV%3f%5cr%14%a6%b7%98%adC%
pub fn bench(c: &mut Criterion) {
c.bench_function("request-from-bytes", |b| {
b.iter(|| Request::from_bytes(black_box(INPUT)))
b.iter(|| Request::parse_bytes(black_box(INPUT)))
});
}