Skip to content

Commit e7b4b85

Browse files
committed
fix: warnings
1 parent 93eb803 commit e7b4b85

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

crates/erg_common/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fn main() -> std::io::Result<()> {
2727
} else {
2828
true
2929
};
30-
println!("cargo:rustc-env=CASE_SENSITIVE={}", case_sensitive);
30+
println!("cargo:rustc-env=CASE_SENSITIVE={case_sensitive}");
3131
Ok(())
3232
}

crates/erg_compiler/hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,8 +1982,8 @@ pub enum GuardClause {
19821982
impl NestedDisplay for GuardClause {
19831983
fn fmt_nest(&self, f: &mut std::fmt::Formatter<'_>, _level: usize) -> std::fmt::Result {
19841984
match self {
1985-
GuardClause::Condition(cond) => write!(f, "{}", cond),
1986-
GuardClause::Bind(bind) => write!(f, "{}", bind),
1985+
GuardClause::Condition(cond) => write!(f, "{cond}"),
1986+
GuardClause::Bind(bind) => write!(f, "{bind}"),
19871987
}
19881988
}
19891989
}

crates/erg_compiler/ty/codeobj.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,14 +642,14 @@ impl CodeObj {
642642
write!(instrs, "{arg} ({})", self.cellvars[arg]).unwrap();
643643
}
644644
Opcode308::JUMP_ABSOLUTE => {
645-
write!(instrs, "{arg} (to {})", arg).unwrap();
645+
write!(instrs, "{arg} (to {arg})").unwrap();
646646
}
647647
Opcode308::JUMP_FORWARD => {
648648
write!(instrs, "{arg} (to {})", idx + arg + 2).unwrap();
649649
}
650650
// REVIEW: *2?
651651
Opcode308::POP_JUMP_IF_FALSE | Opcode308::POP_JUMP_IF_TRUE => {
652-
write!(instrs, "{arg} (to {})", arg).unwrap();
652+
write!(instrs, "{arg} (to {arg})").unwrap();
653653
}
654654
Opcode308::BINARY_ADD
655655
| Opcode308::BINARY_SUBTRACT
@@ -690,14 +690,14 @@ impl CodeObj {
690690
write!(instrs, "{arg} ({})", self.cellvars[arg]).unwrap();
691691
}
692692
Opcode309::JUMP_ABSOLUTE => {
693-
write!(instrs, "{arg} (to {})", arg).unwrap();
693+
write!(instrs, "{arg} (to {arg})").unwrap();
694694
}
695695
Opcode309::JUMP_FORWARD => {
696696
write!(instrs, "{arg} (to {})", idx + arg + 2).unwrap();
697697
}
698698
// REVIEW: *2?
699699
Opcode309::POP_JUMP_IF_FALSE | Opcode309::POP_JUMP_IF_TRUE => {
700-
write!(instrs, "{arg} (to {})", arg).unwrap();
700+
write!(instrs, "{arg} (to {arg})").unwrap();
701701
}
702702
Opcode309::BINARY_ADD
703703
| Opcode309::BINARY_SUBTRACT

crates/erg_compiler/ty/constructors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ pub fn try_v_enum(s: Set<ValueObj>) -> Result<Type, Set<ValueObj>> {
183183
}
184184

185185
pub fn v_enum(s: Set<ValueObj>) -> Type {
186-
try_v_enum(s).unwrap_or_else(|set| panic!("not homogeneous: {}", set))
186+
try_v_enum(s).unwrap_or_else(|set| panic!("not homogeneous: {set}"))
187187
}
188188

189189
pub fn t_enum(s: Set<Type>) -> Type {
190190
try_v_enum(s.into_iter().map(ValueObj::builtin_type).collect())
191-
.unwrap_or_else(|set| panic!("not homogeneous: {}", set))
191+
.unwrap_or_else(|set| panic!("not homogeneous: {set}"))
192192
}
193193

194194
pub fn t_singleton(t: Type) -> Type {

crates/erg_compiler/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ impl LimitedDisplay for SubrType {
451451
}
452452
write!(f, "*")?;
453453
if let Some(name) = var_params.name() {
454-
write!(f, "{}: ", name)?;
454+
write!(f, "{name}: ")?;
455455
}
456456
var_params.typ().limited_fmt(f, limit - 1)?;
457457
}

src/dummy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ impl PackageManagerRunner {
454454
{
455455
Ok(out) => ExitStatus::new(out.status.code().unwrap_or(0), 0, 0),
456456
Err(err) => {
457-
eprintln!("Error: {}", err);
457+
eprintln!("Error: {err}");
458458
ExitStatus::ERR1
459459
}
460460
}

0 commit comments

Comments
 (0)