Skip to content

Commit

Permalink
Apply cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty/Benediction committed Jul 13, 2024
1 parent 176dfb2 commit 4fef05b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
5 changes: 1 addition & 4 deletions cpclib-asm/src/assembler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3168,7 +3168,6 @@ pub fn visit_tokens_one_pass<T: Visited>(tokens: &[T]) -> Result<Env, AssemblerE

macro_rules! visit_token_impl {
($token:ident, $env:ident, $span:ident, $cls:tt) => {{

$env.update_dollar();
match $token {
$cls::Align(ref boundary, ref fill) => $env.visit_align(boundary, fill.as_ref()),
Expand Down Expand Up @@ -4031,7 +4030,6 @@ impl Env {

/// Warnings related code
impl Env {

fn merge_overriding_warnings(&mut self) {
// Filter the warnings to merge overriding
let mut current_warning_idx = 1; // index to the last warning to treat
Expand Down Expand Up @@ -4136,13 +4134,12 @@ impl Env {
}
// change the length of the vector to remove all eated ones
self.warnings.truncate(previous_warning_idx + 1);

}

fn render_warnings(&mut self) {
// transform the warnings as strings
self.warnings.iter_mut().for_each(|w| {
if let AssemblerError::AssemblingError {..} = w {
if let AssemblerError::AssemblingError { .. } = w {
// nothing to do
}
else {
Expand Down
1 change: 0 additions & 1 deletion cpclib-asm/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ impl AssemblerError {
}
}


pub fn format(&self, f: &mut std::fmt::Formatter<'_>, complete: bool) -> std::fmt::Result {
match self {
AssemblerError::SyntaxError { error } => {
Expand Down
5 changes: 1 addition & 4 deletions cpclib-basm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ pub fn parse<'arg>(
};

let res = crate::parse_z80_with_context_builder(code, builder)
.map_err(|e| {
BasmError::from(e.render())
});
.map_err(|e| BasmError::from(e.render()));

if options.show_progress {
Progress::progress().remove_parse(&fname);
Expand Down Expand Up @@ -539,7 +537,6 @@ pub fn process(matches: &ArgMatches) -> Result<(Env, Vec<AssemblerError>), BasmE
// standard assembling
let (listing, options) = parse(matches)?;
let env = assemble(matches, &listing, options).map_err(move |error| {

BasmError::ErrorWithListing {
error: Box::new(error),
listing
Expand Down
8 changes: 2 additions & 6 deletions cpclib-basm/tests/real_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,10 @@ fn expect_failure(fname: &str) {
}
}



#[test]
fn test_at2_akm() {
let args_parser = build_args_parser();
let args =
args_parser.get_matches_from(&["basm", "--db", "tests/asm/at2/test_akm.asm"]);
let args = args_parser.get_matches_from(&["basm", "--db", "tests/asm/at2/test_akm.asm"]);

process(&args).expect("Error while assembling AT2/AKM");

}
}

0 comments on commit 4fef05b

Please sign in to comment.