diff --git a/ylong_http/src/h3/octets.rs b/ylong_http/src/h3/octets.rs index 05f7c7c3b689ecc4ea82458ea636c33bf1b690cc..6595219dde29696d4cb3f23a32890a7596c228c5 100644 --- a/ylong_http/src/h3/octets.rs +++ b/ylong_http/src/h3/octets.rs @@ -284,18 +284,10 @@ impl<'a> WriteVarint<'a> { /// integer. pub const fn varint_len(v: u64) -> usize { match v { - 0..=63 => { - 1 - } - 64..=16383 => { - 2 - } - 16384..=1_073_741_823 => { - 4 - } - 1_073_741_824..=4_611_686_018_427_387_903 => { - 8 - } + 0..=63 => 1, + 64..=16383 => 2, + 16384..=1_073_741_823 => 4, + 1_073_741_824..=4_611_686_018_427_387_903 => 8, _ => {unreachable!()} } } diff --git a/ylong_http_client/examples/async_http.rs b/ylong_http_client/examples/async_http.rs index f2c415f2f48d52259c2271a2b8309a979c4a1d3a..7a1acf2dbb661303efa8d74b70699395daadcfcf 100644 --- a/ylong_http_client/examples/async_http.rs +++ b/ylong_http_client/examples/async_http.rs @@ -33,7 +33,7 @@ async fn client_send() -> Result<(), HttpClientError> { // Creates a `Request`. let request = Request::builder() - .url("https://sf3-cn.feishucdn.com/obj/ee-appcenter/47273f95/Feishu-win32_ia32-7.9.7-signed.exe") + .url("https://www.example.com") .body(Body::empty())?; // Sends request and receives a `Response`. diff --git a/ylong_http_client/src/util/c_openssl/adapter.rs b/ylong_http_client/src/util/c_openssl/adapter.rs index 06bc44302fff905f531f443691461829bdd7c610..b28f1165f2cdc0e7d4e9936b6f2b8ab4cfe9d1bc 100644 --- a/ylong_http_client/src/util/c_openssl/adapter.rs +++ b/ylong_http_client/src/util/c_openssl/adapter.rs @@ -395,7 +395,8 @@ impl TlsConfigBuilder { pub fn build(mut self) -> Result { for cert in self.certs_list { self.inner = self.inner.and_then(|mut builder| { - { Ok(builder.cert_store_mut()).map(|store| store.add_cert(cert.0)) } + Ok(builder.cert_store_mut()) + .and_then(|store| store.add_cert(cert.0)) .map(|_| builder) }); } @@ -403,7 +404,9 @@ impl TlsConfigBuilder { #[cfg(feature = "c_openssl_3_0")] for path in self.paths_list { self.inner = self.inner.and_then(|mut builder| { - { Ok(builder.cert_store_mut()).map(|store| store.add_path(path)) }.map(|_| builder) + Ok(builder.cert_store_mut()) + .and_then(|store| store.add_path(path)) + .map(|_| builder) }); }