Skip to content

Commit

Permalink
New clippy to fix: (#47)
Browse files Browse the repository at this point in the history
* New clippy to fix:

as_bytes exists on String so we can use it directly.

Don't need a # escape on the help string in monitor

* Bump thiserror from 1.0.49 to 1.0.50 (#50)

Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.49 to 1.0.50.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@1.0.49...1.0.50)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump regex from 1.10.0 to 1.10.2 (#49)

Bumps [regex](https://github.com/rust-lang/regex) from 1.10.0 to 1.10.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](rust-lang/regex@1.10.0...1.10.2)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add clippy warning found when testing formatting options

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
jmchacon and dependabot[bot] authored Oct 21, 2023
1 parent 2586357 commit 94b14f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assemble/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn pass1(cpu: &dyn CPU, lines: Lines<BufReader<File>>) -> Result<ASTOutput> {
let upper = token.to_uppercase();

state = match state {
State::Begin => match upper.as_str().as_bytes() {
State::Begin => match upper.as_bytes() {
// We can match an ORG or comment here directly.
[b'O', b'R', b'G', ..] => State::Org,
[b';', ..] => State::Comment(token[1..].into()),
Expand Down
1 change: 1 addition & 0 deletions cpu/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ macro_rules! nop_hlt_test {
let want = want_clocks;
tester!(got == want, d, &cpu, "Invalid clock count. Got {got} clocks and want {want}");
// SAFETY: We know it's an error so unwrap_err is fine.
#[allow(clippy::unwrap_used)]
let err = ret.unwrap_err();
match err.root_cause().downcast_ref::<CPUError>() {
Some(CPUError::Halted{op: _}) => {},
Expand Down
4 changes: 2 additions & 2 deletions monitor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub fn input_loop(
match cmd.as_str() {
"H" | "HELP" => {
pre = Some(
r#"Usage:
r"Usage:
HELP | H - This usage information
RUN | C [true] - run continually until either a breakpoint/watchpoint is hit or a STOP is sent.
If the bool is set to true then a RAM snapshot will be taken on each instruction.
Expand Down Expand Up @@ -130,7 +130,7 @@ L <path> [<start> [<pc>]] - Load a binary image and optionally start loading at
BIN <path> - Dump a memory image of RAM to the given path
PC <addr> - Set the PC to the addr
RESET - Run a reset sequence on the CPU
QUIT | Q - Exit the monitor"#
QUIT | Q - Exit the monitor"
.into(),
);
}
Expand Down

0 comments on commit 94b14f1

Please sign in to comment.