summaryrefslogtreecommitdiff
path: root/src/h3/mod.rs
diff options
context:
space:
mode:
authorGravatar Alessandro Ghedini <alessandro@ghedini.me> 2021-05-06 19:03:19 +0100
committerGravatar Alessandro Ghedini <alessandro@ghedini.me> 2021-05-06 22:18:01 +0100
commitaa13cd3302855dfd4c5e7f7400142b42362f4a05 (patch)
treedae2969cace2d49223fcd65774bc9b98d0618dfe /src/h3/mod.rs
parent0a08fd78134dc35351ce773f143015ed12f53ae1 (diff)
downloadquiche-aa13cd3302855dfd4c5e7f7400142b42362f4a05.tar.gz
quiche-aa13cd3302855dfd4c5e7f7400142b42362f4a05.tar.zst
quiche-aa13cd3302855dfd4c5e7f7400142b42362f4a05.zip
h3: use parse() to convert string to int
Diffstat (limited to '')
-rw-r--r--src/h3/mod.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/h3/mod.rs b/src/h3/mod.rs
index 0b1ede9b..beef46bc 100644
--- a/src/h3/mod.rs
+++ b/src/h3/mod.rs
@@ -830,9 +830,12 @@ impl Connection {
// TODO: this also detects when u is not an sh-integer and
// clamps it in the same way. A real structured header parser
// would actually fail to parse.
- let mut u =
- i64::from_str_radix(param.rsplit('=').next().unwrap(), 10)
- .unwrap_or(7);
+ let mut u = param
+ .rsplit('=')
+ .next()
+ .unwrap()
+ .parse::<i64>()
+ .unwrap_or(7);
if !(0..=7).contains(&u) {
u = 7;