1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-30 08:24:28 +02:00

Actix Web Rustls v0.21 support (#3116)

This commit is contained in:
Rob Ede
2023-08-29 01:11:11 +01:00
committed by GitHub
parent cbf5e948db
commit 905c30af86
23 changed files with 382 additions and 124 deletions

View File

@ -62,6 +62,8 @@ impl ResourcePath for Url {
#[cfg(test)]
mod tests {
use std::fmt::Write as _;
use http::Uri;
use super::*;
@ -78,7 +80,11 @@ mod tests {
}
fn percent_encode(data: &[u8]) -> String {
data.iter().map(|c| format!("%{:02X}", c)).collect()
data.iter()
.fold(String::with_capacity(data.len() * 3), |mut buf, c| {
write!(&mut buf, "%{:02X}", c).unwrap();
buf
})
}
#[test]