Skip to content

Commit

Permalink
Merge pull request #84 from corewa-rs/clippy-format-in-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-h-chamberlain committed Apr 15, 2022
2 parents 93a1707 + a518192 commit 9e7303c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions corewars-core/src/load_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ impl Instruction {

impl fmt::Display for Instruction {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// https://github.com/rust-lang/rust-clippy/issues/8643
#[allow(clippy::format_in_format_args)]
f.pad(&format!(
// Example output:
// MOV.AB $-100, $1
Expand Down
2 changes: 1 addition & 1 deletion corewars-parser/src/phase/expansion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fn expand_lines(lines: &mut Vec<String>, index: usize, span: &Span, substitution
lines.splice(index..=index, new_lines);
}

fn substitute_offsets(lines: &mut Vec<String>, labels: &Labels) {
fn substitute_offsets(lines: &mut [String], labels: &Labels) {
let mut i = 0;
for line in lines.iter_mut() {
let cloned = line.clone();
Expand Down
2 changes: 1 addition & 1 deletion corewars-sim/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl Core {
let max_cycles = max_cycles.into().unwrap_or(DEFAULT_MAXCYCLES);

while self.steps_taken < max_cycles {
let _ = self.step()?;
self.step()?;
}

Ok(())
Expand Down

0 comments on commit 9e7303c

Please sign in to comment.