From 58293ed625309780fc38e25941085ce6fca31c77 Mon Sep 17 00:00:00 2001 From: Chris Mounce Date: Mon, 7 Apr 2025 11:09:45 -0700 Subject: [PATCH] Bump edition to 2024, cargo fmt --- Cargo.toml | 2 +- src/encoding.rs | 2 +- src/main.rs | 4 +++- src/preprocess/eval.rs | 11 +++++++---- src/preprocess/parse.rs | 2 +- src/world.rs | 4 ++-- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ec20dcc..ca7c051 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "assembler" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/encoding.rs b/src/encoding.rs index 4b6c657..5f34066 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -1,4 +1,4 @@ -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use codepage_437::CP437_WINGDINGS; // Serialize multi-line content with CR-terminated lines diff --git a/src/main.rs b/src/main.rs index e2ac414..b998f14 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,9 @@ fn main() -> Result<(), Box> { // Prepare to evaluate macros from the world file's directory let world_pathbuf = PathBuf::from(&world_filename); - let world_dir = world_pathbuf.parent().ok_or(anyhow!("Couldn't get world's directory"))?; + let world_dir = world_pathbuf + .parent() + .ok_or(anyhow!("Couldn't get world's directory"))?; let eval_context = Context::new(&world_dir); println!("num boards: {}", &world.boards.len()); diff --git a/src/preprocess/eval.rs b/src/preprocess/eval.rs index 7eef7cb..1d539aa 100644 --- a/src/preprocess/eval.rs +++ b/src/preprocess/eval.rs @@ -1,9 +1,12 @@ -use std::{fs, path::{Path, PathBuf}}; +use std::{ + fs, + path::{Path, PathBuf}, +}; -use anyhow::{anyhow, bail, Result}; +use anyhow::{Result, anyhow, bail}; use super::{ - parse::{parse, Expr}, + parse::{Expr, parse}, scan::scan, }; @@ -41,7 +44,7 @@ impl Context { pub fn new(working_directory: &Path) -> Self { Context { file_loader: Box::new(FileLoader { - working_dir: working_directory.into() + working_dir: working_directory.into(), }), } } diff --git a/src/preprocess/parse.rs b/src/preprocess/parse.rs index 89eaf62..fb425f2 100644 --- a/src/preprocess/parse.rs +++ b/src/preprocess/parse.rs @@ -1,4 +1,4 @@ -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use super::scan::Token; diff --git a/src/world.rs b/src/world.rs index c9d63f9..46bf6b8 100644 --- a/src/world.rs +++ b/src/world.rs @@ -1,13 +1,13 @@ use std::{error::Error, fmt::Display}; use nom::{ + Err, IResult, Parser, bytes::complete::{tag, take}, combinator::fail, error::{ErrorKind, ParseError}, multi::count, - number::complete::{le_i16, le_u16, le_u8}, + number::complete::{le_i16, le_u8, le_u16}, sequence::tuple, - Err, IResult, Parser, }; #[derive(Debug)]