Skip to content

Commit

Permalink
Clippies for rust 1.59. (#179)
Browse files Browse the repository at this point in the history
* Clippies for rust 1.59.

* Fmt fix
  • Loading branch information
gmorpheme authored Mar 3, 2022
1 parent 4c76924 commit 13b8df2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
12 changes: 4 additions & 8 deletions src/driver/tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub struct InProcessTester {}

/// TODO: eu escaping
fn quote<T: AsRef<str>>(text: T) -> String {
format!("\"{}\"", text.as_ref().replace("\"", "\\\""))
format!("\"{}\"", text.as_ref().replace('\"', "\\\""))
}

/// Convert stats to a core expression for output
Expand Down Expand Up @@ -253,13 +253,13 @@ impl InProcessTester {
let stdout = Input::new(
Locator::Literal(result.stdout.clone()),
Some(format!("{}-{}-stdout-text", &target_name, &format)),
"text".to_string(),
"text",
);
// Literal stderr
let stderr = Input::new(
Locator::Literal(result.stderr),
Some(format!("{}-{}-stderr-text", &target_name, &format)),
"text".to_string(),
"text",
);

let mut expectations: Vec<String> = result
Expand Down Expand Up @@ -310,11 +310,7 @@ impl InProcessTester {
writeln!(&mut evidence_script, "}}\n")?;

let evidence_script_text = std::str::from_utf8(&evidence_script).unwrap().to_string();
let evidence_input = Input::new(
Locator::Literal(evidence_script_text),
None,
"eu".to_string(),
);
let evidence_input = Input::new(Locator::Literal(evidence_script_text), None, "eu");
inputs.push(evidence_input);

let evidence_file = plan.evidence_file_name();
Expand Down
2 changes: 1 addition & 1 deletion src/eval/stg/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl StgIntrinsic for ZdtFields {
let hour = dt.hour();
let min = dt.minute();
let sec = (dt.second() as f64) + (dt.timestamp_subsec_millis() as f64) / 1000f64;
let tz = dt.offset().to_string().replace(":", "");
let tz = dt.offset().to_string().replace(':', "");

let mut fields = IndexMap::new();
fields.insert(
Expand Down
5 changes: 1 addition & 4 deletions src/import/edn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ fn value_to_core(edn: &Value, file_id: usize) -> Result<RcExpr, SourceError> {
)), // NB. no core primitive for datetime right now
Value::Uuid(uuid) => Ok(acore::meta(
acore::str(uuid.to_string()),
acore::block(iter::once((
"tag".to_string(),
acore::str("uuid".to_string()),
))),
acore::block(iter::once(("tag".to_string(), acore::str("uuid")))),
)),
Value::TaggedElement(t, e) => Ok(acore::meta(
value_to_core(e, file_id)?,
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/export/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub trait ToSourceDoc {
}

fn escape_string_literal(s: &str) -> String {
s.replace("{", "{{").replace("}", "}}")
s.replace('{', "{{").replace('}', "}}")
}

impl ToSourceDoc for Literal {
Expand Down

0 comments on commit 13b8df2

Please sign in to comment.