Skip to content

Commit a68d7f9

Browse files
authored
Edition 2018 (#121)
* Edition 2018 * Fix unused const on aarch64 * Fix Edition 2018 for SIMD
1 parent 0e1e0b0 commit a68d7f9

File tree

9 files changed

+138
-136
lines changed

9 files changed

+138
-136
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/httparse"
1010
readme = "README.md"
1111
keywords = ["http", "parser", "no_std"]
1212
categories = ["network-programming", "no-std", "parser-implementations", "web-programming"]
13-
13+
edition = "2018"
1414
build = "build.rs"
1515

1616
[features]

benches/parse.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
extern crate criterion;
2-
extern crate httparse;
31

42
use std::time::Duration;
53

64
use criterion::{black_box, criterion_group, criterion_main, Criterion, Throughput};
75

8-
const REQ_SHORT: &'static [u8] = b"\
6+
const REQ_SHORT: &[u8] = b"\
97
GET / HTTP/1.0\r\n\
108
Host: example.com\r\n\
119
Cookie: session=60; user_id=1\r\n\r\n";
1210

13-
const REQ: &'static [u8] = b"\
11+
const REQ: &[u8] = b"\
1412
GET /wp-content/uploads/2010/03/hello-kitty-darth-vader-pink.jpg HTTP/1.1\r\n\
1513
Host: www.kittyhell.com\r\n\
1614
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ja-JP-mac; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Pathtraq/0.9\r\n\
@@ -44,13 +42,13 @@ fn req_short(c: &mut Criterion) {
4442
}));
4543
}
4644

47-
const RESP_SHORT: &'static [u8] = b"\
45+
const RESP_SHORT: &[u8] = b"\
4846
HTTP/1.0 200 OK\r\n\
4947
Date: Wed, 21 Oct 2015 07:28:00 GMT\r\n\
5048
Set-Cookie: session=60; user_id=1\r\n\r\n";
5149

5250
// These particular headers don't all make semantic sense for a response, but they're syntactically valid.
53-
const RESP: &'static [u8] = b"\
51+
const RESP: &[u8] = b"\
5452
HTTP/1.1 200 OK\r\n\
5553
Date: Wed, 21 Oct 2015 07:28:00 GMT\r\n\
5654
Host: www.kittyhell.com\r\n\

src/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<'a> Bytes<'a> {
2828

2929
#[inline]
3030
pub fn peek_ahead(&self, n: usize) -> Option<u8> {
31-
self.slice.get(self.pos + n).cloned()
31+
self.slice.get(self.pos + n).copied()
3232
}
3333

3434
#[inline]

0 commit comments

Comments
 (0)