Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mkatychev committed Jan 21, 2024
1 parent e122d64 commit 89276ba
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions filmreel/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum FrError {
Serde(String),
Parse(String),
File(String, String),
Pest(PestError<Rule>),
Pest(Box<PestError<Rule>>),
}

impl Error for FrError {
Expand All @@ -39,7 +39,7 @@ impl From<SerdeError> for FrError {

impl From<PestError<Rule>> for FrError {
fn from(err: PestError<Rule>) -> FrError {
Self::Pest(err)
Self::Pest(Box::new(err))
}
}

Expand Down
2 changes: 1 addition & 1 deletion filmreel/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl Validator {
// NOTE: Array partial matches need to be ordered as well as contiguous.
// The example below would not result in a match:
// Other: [A, B, B, C, A, B, B, C]
for i in (0..other_selection.len()) {
for i in 0..other_selection.len() {
if i + self_len > other_selection.len() {
// other_selection[i..] is already larger than self_selection here
// cannot find a partial match at this point
Expand Down
4 changes: 2 additions & 2 deletions filmreel/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ where

#[cfg(feature = "full_jql")]
pub fn select_value(val: &Value, query: &str) -> Result<Value, FrError> {
let selectors = query.replace("'", "\"");
match jql::walker(val, Some(&selectors)) {
let selectors = query.replace('\'', "\"");
match jql::walker(val, selectors.as_ref()) {
Ok(v) => match v {
Value::String(_) => Ok(v),
v => Ok(v),
Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ use_small_heuristics = "Default"
use_try_shorthand = true
trailing_comma = "Vertical"
struct_field_align_threshold = 20
enum_discrim_align_threshold = 20
unstable_features = true
15 changes: 5 additions & 10 deletions src/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn process_response<'a, 'b>(
"{}",
PrettyDifference {
expected: &frame.response.to_string_pretty()?,
actual: &payload_response.to_string_pretty()?,
actual: &payload_response.to_string_pretty()?,
}
);
error!(
Expand Down Expand Up @@ -172,12 +172,7 @@ pub fn run_take<'a>(
hidden.to_coloured_tk_json()?,
]);
table.printstd();
write!(
stdout,
"{}",
format!("Press {} to continue...", "ENTER".yellow())
)
.expect("write to stdout panic");
write!(stdout, "Press {} to continue...", "ENTER".yellow()).expect("write to stdout panic");
stdout.flush().expect("stdout flush panic");

// Read a single byte and discard
Expand Down Expand Up @@ -332,10 +327,10 @@ mod tests {
)
.unwrap();
let payload_response = Response {
body: Some(json!("created user: BIG_BEN")),
etc: Some(json!({})),
body: Some(json!("created user: BIG_BEN")),
etc: Some(json!({})),
validation: None,
status: 200,
status: 200,
};
let mut register = Register::default();
let params = Params::default();
Expand Down

0 comments on commit 89276ba

Please sign in to comment.