aboutsummaryrefslogtreecommitdiff
path: root/src/request
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-05-18 01:52:36 +0000
committerFuwn <[email protected]>2022-05-18 01:52:36 +0000
commit11405ce0600d61f3772a7efe7fbd3de4cc2bf892 (patch)
tree24ebda9cc59ae51b4e87fdde688fe009eaf420af /src/request
parentchore(makefile): use --all-features (diff)
downloadgerm-11405ce0600d61f3772a7efe7fbd3de4cc2bf892.tar.xz
germ-11405ce0600d61f3772a7efe7fbd3de4cc2bf892.zip
fix: global clippy lint fixes
Diffstat (limited to 'src/request')
-rw-r--r--src/request/response.rs13
-rw-r--r--src/request/status.rs2
-rw-r--r--src/request/verifier.rs2
3 files changed, 7 insertions, 10 deletions
diff --git a/src/request/response.rs b/src/request/response.rs
index 0202967..e96cee0 100644
--- a/src/request/response.rs
+++ b/src/request/response.rs
@@ -29,21 +29,18 @@ pub struct Response {
pub suite: Option<SupportedCipherSuite>,
}
impl Response {
- pub(super) fn new(
- data: Vec<u8>,
- suite: Option<SupportedCipherSuite>,
- ) -> Self {
- let string_form = String::from_utf8_lossy(&data).to_string();
+ pub(super) fn new(data: &[u8], suite: Option<SupportedCipherSuite>) -> Self {
+ let string_form = String::from_utf8_lossy(data).to_string();
let mut content = None;
let header;
- if !string_form.ends_with("\r\n") {
+ if string_form.ends_with("\r\n") {
+ header = string_form;
+ } else {
let mut string_split = string_form.split("\r\n");
header = string_split.next().unwrap_or("").to_string();
content = Some(string_split.collect());
- } else {
- header = string_form;
}
let header_split = header.split_at(2);
diff --git a/src/request/status.rs b/src/request/status.rs
index b2065ed..8a18ce7 100644
--- a/src/request/status.rs
+++ b/src/request/status.rs
@@ -72,7 +72,7 @@ impl From<Status> for i32 {
Status::ClientCertificateRequired => 60,
Status::CertificateNotAuthorised => 61,
Status::CertificateNotValid => 62,
- _ => 0,
+ Status::Unsupported => 0,
}
}
}
diff --git a/src/request/verifier.rs b/src/request/verifier.rs
index f2c6a35..d6511c3 100644
--- a/src/request/verifier.rs
+++ b/src/request/verifier.rs
@@ -22,7 +22,7 @@ use rustls::{client, client::ServerCertVerified, Certificate};
pub(super) struct GermVerifier;
impl GermVerifier {
- pub fn new() -> Self { Self {} }
+ pub const fn new() -> Self { Self {} }
}
impl client::ServerCertVerifier for GermVerifier {
fn verify_server_cert(