Skip to content

Commit

Permalink
chore: solve clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Oct 11, 2023
1 parent 9bae448 commit af5ff86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rad/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ fn headers_response_with_data_report(
let mut headers: BTreeMap<String, Vec<RadonTypes>> = BTreeMap::new();

for line in response.split("\r\n") {
if let Some(first_colon_index) = line.find(":") {
if let Some(first_colon_index) = line.find(':') {
// key: trim spaces and lower case all ascii chars left to the first colon character
let key = String::from(line[0..first_colon_index].trim().to_ascii_lowercase());
let key = line[0..first_colon_index].trim().to_ascii_lowercase();
// value: trim spaces on the substring after the first colon character
let value = RadonTypes::from(RadonString::from(line[first_colon_index + 1..].trim()));
headers.entry(key).or_default().push(value);
Expand Down Expand Up @@ -692,7 +692,7 @@ fn validate_header(name: &str, value: &str) -> Result<()> {
Err(RadError::InvalidHttpHeader {
name: name.to_string(),
value: value.to_string(),
error: error_message.to_string(),
error: error_message,
})
} else {
Ok(())
Expand Down

0 comments on commit af5ff86

Please sign in to comment.