Skip to content

Commit 439d1c5

Browse files
committed
chore: add FUNDING.yml
1 parent b531947 commit 439d1c5

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: seanmonstar

src/version.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ impl Version {
4343
}
4444

4545
#[derive(PartialEq, PartialOrd, Copy, Clone, Eq, Ord, Hash)]
46+
#[non_exhaustive]
4647
enum Http {
4748
Http09,
4849
Http10,
4950
Http11,
5051
H2,
5152
H3,
52-
__NonExhaustive,
53+
//__NonExhaustive,
5354
}
5455

5556
impl Default for Version {
@@ -69,7 +70,7 @@ impl fmt::Debug for Version {
6970
Http11 => "HTTP/1.1",
7071
H2 => "HTTP/2.0",
7172
H3 => "HTTP/3.0",
72-
__NonExhaustive => unreachable!(),
73+
//__NonExhaustive => unreachable!(),
7374
})
7475
}
7576
}

tests/match_patterns.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#[test]
2+
fn match_scheme() {
3+
let s = http::uri::Scheme::HTTP;
4+
5+
match s {
6+
http::uri::Scheme::HTTP => (),
7+
http::uri::Scheme::HTTPS | _ => {
8+
panic!("unexpected match: {:?}", s);
9+
}
10+
}
11+
}
12+
13+
#[test]
14+
fn match_metcho() {
15+
let m = "GET".parse::<http::Method>().unwrap();
16+
17+
match m {
18+
http::Method::GET => (),
19+
http::Method::POST | _ => {
20+
panic!("unexpected match: {:?}", m);
21+
}
22+
}
23+
}
24+
25+
#[test]
26+
fn match_status() {
27+
28+
}
29+
30+
#[test]
31+
fn match_version() {
32+
match http::Version::default() {
33+
http::Version::HTTP_09 => (),
34+
http::Version::HTTP_10 => (),
35+
http::Version::HTTP_11 => (),
36+
http::Version::HTTP_2 => (),
37+
http::Version::HTTP_3 => (),
38+
_ => (),
39+
}
40+
}

0 commit comments

Comments
 (0)