Clippy formatting (#131)

* Clippy with Rust 1.67

* Clippy/Rustfmt with Rust 1.66.1
This commit is contained in:
Samuel Burnham
2023-01-31 17:53:15 -05:00
committed by GitHub
parent 74501936c3
commit b2adab610a
14 changed files with 60 additions and 71 deletions

View File

@@ -122,13 +122,13 @@ where
let mut result = Vec::new();
for input in &self.inputs {
result.push(format!("INPUT {}", input));
result.push(format!("INPUT {input}"));
}
for aux in &self.aux {
result.push(format!("AUX {}", aux));
result.push(format!("AUX {aux}"));
}
for &(ref _a, ref _b, ref _c, ref name) in &self.constraints {
for (_a, _b, _c, name) in &self.constraints {
result.push(name.to_string());
}
@@ -164,12 +164,12 @@ where
if coeff != <G::Scalar>::one() && coeff != negone {
for (i, x) in powers_of_two.iter().enumerate() {
if x == &coeff {
write!(s, "2^{} . ", i).unwrap();
write!(s, "2^{i} . ").unwrap();
break;
}
}
write!(s, "{:?} . ", coeff).unwrap()
write!(s, "{coeff:?} . ").unwrap()
}
match var.0.get_unchecked() {
@@ -188,10 +188,10 @@ where
s.push(')');
};
for &(ref a, ref b, ref c, ref name) in &self.constraints {
for (a, b, c, name) in &self.constraints {
s.push('\n');
write!(s, "{}: ", name).unwrap();
write!(s, "{name}: ").unwrap();
pp(&mut s, a);
write!(s, " * ").unwrap();
pp(&mut s, b);
@@ -209,8 +209,7 @@ where
fn set_named_obj(&mut self, path: String, to: NamedObject) {
assert!(
!self.named_objects.contains_key(&path),
"tried to create object at existing path: {}",
path
"tried to create object at existing path: {path}"
);
self.named_objects.insert(path, to);

View File

@@ -43,7 +43,7 @@ where
&self
.a
.iter()
.map(|v| format!("Fr({:?})", v))
.map(|v| format!("Fr({v:?})"))
.collect::<Vec<_>>(),
)
.field(
@@ -51,7 +51,7 @@ where
&self
.b
.iter()
.map(|v| format!("Fr({:?})", v))
.map(|v| format!("Fr({v:?})"))
.collect::<Vec<_>>(),
)
.field(
@@ -59,7 +59,7 @@ where
&self
.c
.iter()
.map(|v| format!("Fr({:?})", v))
.map(|v| format!("Fr({v:?})"))
.collect::<Vec<_>>(),
)
.field("input_assignment", &self.input_assignment)