Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Oct 13, 2022
1 parent e3d516d commit 8325bfc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/cmd/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ pub fn run(argv: &[&str]) -> CliResult<()> {

let mut redis_conn;
match redis_client.get_connection() {
Err(e) => return fail_clierror!(r#"Cannot connect to Redis using "{conn_str}": {e:?}"#),
Err(e) => {
return fail_clierror!(r#"Cannot connect to Redis using "{conn_str}": {e:?}"#)
}
Ok(x) => redis_conn = x,
}

Expand Down
4 changes: 3 additions & 1 deletion src/cmd/fetchpost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ pub fn run(argv: &[&str]) -> CliResult<()> {

let mut redis_conn;
match redis_client.get_connection() {
Err(e) => return fail_clierror!(r#"Cannot connect to Redis using "{conn_str}": {e:?}"#),
Err(e) => {
return fail_clierror!(r#"Cannot connect to Redis using "{conn_str}": {e:?}"#)
}
Ok(x) => redis_conn = x,
}

Expand Down
9 changes: 5 additions & 4 deletions src/cmd/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,7 @@ fn init_date_inference(
match INFER_DATE_FLAGS.set(vec![true; headers.len()]) {
Ok(_) => (),
Err(e) => {
return fail_format!(
"Cannot init date inference flags for ALL fields - {e:?}"
)
return fail_format!("Cannot init date inference flags for ALL fields - {e:?}")
}
};
} else {
Expand Down Expand Up @@ -641,7 +639,10 @@ impl Stats {
// calculate skewness using Quantile-based measures
// https://en.wikipedia.org/wiki/Skewness#Quantile-based_measures
// skewness = (q3 - (2.0 * q2) + q1) / iqr
pieces.push(round_num((2.0f64.mul_add(-q2, q3) + q1) / iqr, round_places));
pieces.push(round_num(
(2.0f64.mul_add(-q2, q3) + q1) / iqr,
round_places,
));
}
}
match self.modes.as_mut() {
Expand Down
4 changes: 1 addition & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ impl Delimiter {
}

if s.len() != 1 {
return fail_format!(
"Could not convert '{s}' to a single ASCII character."
);
return fail_format!("Could not convert '{s}' to a single ASCII character.");
}

let c = s.chars().next().unwrap();
Expand Down
5 changes: 1 addition & 4 deletions src/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ impl SelectorParser {
fn parse(&mut self) -> Result<Vec<Selector>, String> {
if (self.chars.first(), self.chars.last()) == (Some(&'/'), Some(&'/')) {
if self.chars.len() == 2 {
return fail_format!(
"Empty regex: {}",
self.chars.iter().collect::<String>()
);
return fail_format!("Empty regex: {}", self.chars.iter().collect::<String>());
}
let re: String = self.chars[1..(self.chars.len() - 1)].iter().collect();
let regex = match Regex::new(&re) {
Expand Down

0 comments on commit 8325bfc

Please sign in to comment.