Skip to content

Commit

Permalink
reformat with rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hafihaf123 committed Jan 17, 2025
1 parent d4fa1ad commit e66d95b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions rama-http/src/headers/util/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ where
{
values
.flat_map(|value| {
value.to_str().into_iter().flat_map(|string| {
split_csv_str(string)
})
value
.to_str()
.into_iter()
.flat_map(|string| split_csv_str(string))
})
.collect()
}
Expand Down
4 changes: 2 additions & 2 deletions rama-http/src/headers/util/value_string.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{
fmt,
str::{self, FromStr},
fmt,
str::{self, FromStr},
};

use bytes::Bytes;
Expand Down
2 changes: 1 addition & 1 deletion rama-http/src/headers/x_robots_tag/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl FromStr for Element {
.context("Failed to capture the target bot name")?
.as_str()
.trim();

if bot_name_candidate.parse::<Rule>().is_err() {
bot_name = HeaderValueString::from_string(bot_name_candidate.to_owned());
rules_str = captures
Expand Down
2 changes: 1 addition & 1 deletion rama-http/src/headers/x_robots_tag/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ mod valid_date;

use crate::headers::Header;
use element::Element;
use http::{HeaderName, HeaderValue};
use element_iter::ElementIter;
use http::{HeaderName, HeaderValue};
use std::fmt::Formatter;
use std::iter::Iterator;

Expand Down
4 changes: 3 additions & 1 deletion rama-http/src/headers/x_robots_tag/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ impl<'a> Rule {
Some("no_snippet") => Ok(Rule::NoSnippet),
Some("indexifembedded") => Ok(Rule::IndexIfEmbedded),
Some("max-snippet") => match value.next() {
Some(number) => Ok(Rule::MaxSnippet(number.parse().map_err(OpaqueError::from_display)?)),
Some(number) => Ok(Rule::MaxSnippet(
number.parse().map_err(OpaqueError::from_display)?,
)),
None => Err(OpaqueError::from_display(
"No number specified for 'max-snippet'",
)),
Expand Down

0 comments on commit e66d95b

Please sign in to comment.