Skip to content

Commit dc58555

Browse files
authored
clippy (#1272)
1 parent f5e57be commit dc58555

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

crates/flux-bin/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn parse_output(output: Output) -> Option<String> {
77
fn git_sha() -> Option<String> {
88
parse_output(
99
Command::new("git")
10-
.args(&["describe", "--always", "--dirty=*"])
10+
.args(["describe", "--always", "--dirty=*"])
1111
.output()
1212
.ok()?,
1313
)
@@ -16,7 +16,7 @@ fn git_sha() -> Option<String> {
1616
fn git_date() -> Option<String> {
1717
parse_output(
1818
Command::new("git")
19-
.args(&["show", "-s", "--format=%cd", "--date=format:%Y-%m-%d", "HEAD"])
19+
.args(["show", "-s", "--format=%cd", "--date=format:%Y-%m-%d", "HEAD"])
2020
.output()
2121
.ok()?,
2222
)

crates/flux-bin/src/bin/cargo-flux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ fn serde_json_to_config(
199199
return Err(config::ConfigError::Message("invalid number".to_string()));
200200
}
201201
}
202-
serde_json::Value::String(s) => config::ValueKind::String(s.to_string()),
202+
serde_json::Value::String(s) => config::ValueKind::String(s.clone()),
203203
serde_json::Value::Array(values) => {
204204
config::ValueKind::Array(
205205
values
@@ -211,7 +211,7 @@ fn serde_json_to_config(
211211
serde_json::Value::Object(map) => {
212212
config::ValueKind::Table(
213213
map.iter()
214-
.map(|(k, v)| Ok((k.to_string(), serde_json_to_config(v, origin)?)))
214+
.map(|(k, v)| Ok((k.clone(), serde_json_to_config(v, origin)?)))
215215
.try_collect()?,
216216
)
217217
}

crates/flux-desugar/src/desugar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ impl<'a, 'genv, 'tcx: 'genv> RustItemCtxt<'a, 'genv, 'tcx> {
660660
span: loc.span,
661661
};
662662
let ty = self.desugar_ty(ty);
663-
Ok(fhir::Ensures::Type(path, ty))
663+
Ok(fhir::Ensures::Type(path, self.genv().alloc(ty)))
664664
}
665665
surface::Ensures::Pred(e) => {
666666
let pred = self.desugar_expr(e);

crates/flux-middle/src/fhir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ pub struct FnOutput<'fhir> {
509509
#[derive(Clone, Copy)]
510510
pub enum Ensures<'fhir> {
511511
/// A type constraint on a location
512-
Type(PathExpr<'fhir>, Ty<'fhir>),
512+
Type(PathExpr<'fhir>, &'fhir Ty<'fhir>),
513513
/// A predicate that needs to hold on function exit
514514
Pred(Expr<'fhir>),
515515
}

crates/flux-refineck/src/ghost_statements.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl GhostStatements {
143143
use rustc_middle::mir::{PassWhere, pretty::MirDumper};
144144
if let Some(dumper) = MirDumper::new(tcx, "ghost", body.inner()) {
145145
dumper
146-
.set_extra_data(&mut |pass, w| {
146+
.set_extra_data(&|pass, w| {
147147
match pass {
148148
PassWhere::BeforeBlock(bb) if bb == START_BLOCK => {
149149
for stmt in &self.at_start {

0 commit comments

Comments
 (0)