Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb508487

Browse files
committed
Fix the benchmarks
1 parent69c0d5b commitb508487

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

‎benchmarks/benches/http.rs‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ struct Header<'a> {
2222

2323
#[cfg_attr(rustfmt, rustfmt_skip)]
2424
#[cfg_attr(feature ="cargo-clippy", allow(match_same_arms))]
25-
fnis_token(c:u8) ->bool{
26-
match c{
25+
fnis_token(c:&u8) ->bool{
26+
match*c{
2727
128..=255 =>false,
2828
0..=31 =>false,
2929
b'(' =>false,
@@ -48,23 +48,23 @@ fn is_token(c: u8) -> bool {
4848
}
4949
}
5050

51-
fnnot_line_ending(c:u8) ->bool{
52-
c !=b'\r' && c !=b'\n'
51+
fnnot_line_ending(c:&u8) ->bool{
52+
*c !=b'\r' &&*c !=b'\n'
5353
}
5454

55-
fnis_space(c:u8) ->bool{
56-
c ==b' '
55+
fnis_space(c:&u8) ->bool{
56+
*c ==b' '
5757
}
5858

59-
fnis_not_space(c:u8) ->bool{
60-
c !=b' '
59+
fnis_not_space(c:&u8) ->bool{
60+
*c !=b' '
6161
}
62-
fnis_horizontal_space(c:u8) ->bool{
63-
c ==b' ' || c ==b'\t'
62+
fnis_horizontal_space(c:&u8) ->bool{
63+
*c ==b' ' ||*c ==b'\t'
6464
}
6565

66-
fnis_version(c:u8) ->bool{
67-
c >=b'0' && c <=b'9' || c ==b'.'
66+
fnis_version(c:&u8) ->bool{
67+
*c >=b'0' &&*c <=b'9' ||*c ==b'.'
6868
}
6969

7070
fnline_ending<'a>()->implParser<&'a[u8],Output=&'a[u8],Error=Error<&'a[u8]>>{

‎benchmarks/benches/http_streaming.rs‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ struct Header<'a> {
2222

2323
#[cfg_attr(rustfmt, rustfmt_skip)]
2424
#[cfg_attr(feature ="cargo-clippy", allow(match_same_arms))]
25-
fnis_token(c:u8) ->bool{
26-
match c{
25+
fnis_token(c:&u8) ->bool{
26+
match*c{
2727
128..=255 =>false,
2828
0..=31 =>false,
2929
b'(' =>false,
@@ -48,23 +48,23 @@ fn is_token(c: u8) -> bool {
4848
}
4949
}
5050

51-
fnnot_line_ending(c:u8) ->bool{
52-
c !=b'\r' && c !=b'\n'
51+
fnnot_line_ending(c:&u8) ->bool{
52+
*c !=b'\r' &&*c !=b'\n'
5353
}
5454

55-
fnis_space(c:u8) ->bool{
56-
c ==b' '
55+
fnis_space(c:&u8) ->bool{
56+
*c ==b' '
5757
}
5858

59-
fnis_not_space(c:u8) ->bool{
60-
c !=b' '
59+
fnis_not_space(c:&u8) ->bool{
60+
*c !=b' '
6161
}
62-
fnis_horizontal_space(c:u8) ->bool{
63-
c ==b' ' || c ==b'\t'
62+
fnis_horizontal_space(c:&u8) ->bool{
63+
*c ==b' ' ||*c ==b'\t'
6464
}
6565

66-
fnis_version(c:u8) ->bool{
67-
c >=b'0' && c <=b'9' || c ==b'.'
66+
fnis_version(c:&u8) ->bool{
67+
*c >=b'0' &&*c <=b'9' ||*c ==b'.'
6868
}
6969

7070
fnrequest_line(input:&[u8]) ->IResult<&[u8],Request<'_>>{

‎benchmarks/benches/ini.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::str;
1818

1919
fncategory(i:&[u8]) ->IResult<&[u8],&str>{
2020
map_res(
21-
delimited(char('['),take_while(|c|c !=b']'),char(']')),
21+
delimited(char('['),take_while(|c:&u8|*c !=b']'),char(']')),
2222
str::from_utf8,
2323
)
2424
.parse_complete(i)
@@ -28,8 +28,8 @@ fn key_value(i: &[u8]) -> IResult<&[u8], (&str, &str)> {
2828
let(i, key) =map_res(alphanumeric, str::from_utf8).parse_complete(i)?;
2929
let(i, _) =tuple((opt(space),char('='),opt(space))).parse_complete(i)?;
3030
let(i, val) =
31-
map_res(take_while(|c|c !=b'\n' && c !=b';'), str::from_utf8).parse_complete(i)?;
32-
let(i, _) =opt(pair(char(';'),take_while(|c|c !=b'\n'))).parse_complete(i)?;
31+
map_res(take_while(|c:&u8|*c !=b'\n' &&*c !=b';'), str::from_utf8).parse_complete(i)?;
32+
let(i, _) =opt(pair(char(';'),take_while(|c:&u8|*c !=b'\n'))).parse_complete(i)?;
3333
Ok((i,(key, val)))
3434
}
3535

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp