Repository: bytecodealliance/wasm-tools
Pull request #2233 (2025-06-12 18:03:56)

Use the 2024 style edition in this repository
In lieu of using the 2024 edition entirely, which is not compatible with the current MSRV, this instead adds a `rustfmt.toml` which updates the `style_edition` to 2024 so editor tooling can use 2024 by default.


Patch:
diff --git a/ci/publish.rs b/ci/publish.rs
index cabc3ccc..e63a8ebf 100644
--- a/ci/publish.rs
+++ b/ci/publish.rs
@@ -74,11 +74,13 @@ fn main() {
                 bump_version(&krate, &crates, name == "bump-patch");
             }
             // update the lock file
-            assert!(Command::new("cargo")
-                .arg("fetch")
-                .status()
-                .unwrap()
-                .success());
+            assert!(
+                Command::new("cargo")
+                    .arg("fetch")
+                    .status()
+                    .unwrap()
+                    .success()
+            );
         }
 
         "publish" => {
diff --git a/crates/fuzz-stats/src/bin/failed-instantiations.rs b/crates/fuzz-stats/src/bin/failed-instantiations.rs
index efcd9fe5..bc37a233 100644
--- a/crates/fuzz-stats/src/bin/failed-instantiations.rs
+++ b/crates/fuzz-stats/src/bin/failed-instantiations.rs
@@ -1,7 +1,7 @@
 use arbitrary::{Arbitrary, Error, Unstructured};
 use rand::RngCore;
-use std::sync::atomic::{AtomicIsize, AtomicUsize, Ordering::SeqCst};
 use std::sync::Arc;
+use std::sync::atomic::{AtomicIsize, AtomicUsize, Ordering::SeqCst};
 use wasmtime::*;
 
 struct State {
diff --git a/crates/wasm-compose/example/middleware/src/lib.rs b/crates/wasm-compose/example/middleware/src/lib.rs
index 9aa2ad06..2ddcc7b4 100644
--- a/crates/wasm-compose/example/middleware/src/lib.rs
+++ b/crates/wasm-compose/example/middleware/src/lib.rs
@@ -7,7 +7,7 @@ use bindings::{
     },
     exports::example::service::handler,
 };
-use flate2::{write::GzEncoder, Compression};
+use flate2::{Compression, write::GzEncoder};
 use std::io::Write;
 
 struct Component;
diff --git a/crates/wasm-compose/example/server/src/main.rs b/crates/wasm-compose/example/server/src/main.rs
index 73cbe295..d1202b2e 100644
--- a/crates/wasm-compose/example/server/src/main.rs
+++ b/crates/wasm-compose/example/server/src/main.rs
@@ -2,16 +2,16 @@ use async_trait::async_trait;
 use clap::Parser;
 use std::path::{Path, PathBuf};
 use tide::{
+    Request, Response, StatusCode,
     http::{
         headers::{HeaderName, HeaderValue},
         mime,
     },
     utils::After,
-    Request, Response, StatusCode,
 };
 
-use wasmtime::{component::*, Config, Engine, Store};
-use wasmtime_wasi::preview2::{command, Table, WasiCtx, WasiCtxBuilder, WasiView};
+use wasmtime::{Config, Engine, Store, component::*};
+use wasmtime_wasi::preview2::{Table, WasiCtx, WasiCtxBuilder, WasiView, command};
 
 use example::service::{
     logging::{self, HostLogger},
diff --git a/crates/wasm-compose/src/composer.rs b/crates/wasm-compose/src/composer.rs
index 8634d5cb..6088bcdd 100644
--- a/crates/wasm-compose/src/composer.rs
+++ b/crates/wasm-compose/src/composer.rs
@@ -8,13 +8,13 @@ use crate::{
         InstanceId,
     },
 };
-use anyhow::{anyhow, bail, Context, Result};
+use anyhow::{Context, Result, anyhow, bail};
 use indexmap::IndexMap;
 use std::{collections::VecDeque, ffi::OsStr, path::Path};
 use wasmparser::{
+    ComponentExternalKind, ComponentTypeRef, Validator, WasmFeatures,
     component_types::{ComponentEntityType, ComponentInstanceTypeId},
     types::TypesRef,
-    ComponentExternalKind, ComponentTypeRef, Validator, WasmFeatures,
 };
 
 /// The root component name used in configuration.
@@ -193,10 +193,14 @@ impl<'a> CompositionGraphBuilder<'a> {
             }
             None => {
                 if self.config.disallow_imports {
-                    bail!("a dependency named `{component_name}` could not be found and instance imports are not allowed");
+                    bail!(
+                        "a dependency named `{component_name}` could not be found and instance imports are not allowed"
+                    );
                 }
 
-                log::warn!("instance `{name}` will be imported because a dependency named `{component_name}` could not be found");
+                log::warn!(
+                    "instance `{name}` will be imported because a dependency named `{component_name}` could not be found"
+                );
                 Ok(None)
             }
         }
@@ -223,11 +227,15 @@ impl<'a> CompositionGraphBuilder<'a> {
         // Check if the instance or one of its exports is compatible with the expected import type
         if component.is_instance_subtype_of(ty, types) {
             // The instance itself can be used
-            log::debug!("instance `{instance_name}` can be used for argument `{arg_name}` of instance `{dependent_name}`");
+            log::debug!(
+                "instance `{instance_name}` can be used for argument `{arg_name}` of instance `{dependent_name}`"
+            );
             return Ok(None);
         }
 
-        log::debug!("searching for compatible export from instance `{instance_name}` for argument `{arg_name}` of instance `{dependent_name}`");
+        log::debug!(
+            "searching for compatible export from instance `{instance_name}` for argument `{arg_name}` of instance `{dependent_name}`"
+        );
 
         let export = component.find_compatible_export(ty, types, component_id, &self.graph).ok_or_else(|| {
             anyhow!(
@@ -407,7 +415,9 @@ impl<'a> CompositionGraphBuilder<'a> {
             }
             None => {
                 if let Some(export) = export {
-                    bail!("an explicit export `{export}` cannot be specified for imported instance `{name}`");
+                    bail!(
+                        "an explicit export `{export}` cannot be specified for imported instance `{name}`"
+                    );
                 }
                 Ok(None)
             }
@@ -423,7 +433,10 @@ impl<'a> CompositionGraphBuilder<'a> {
 
         // Push a dependency for every instance import
         'outer: for (import, name, _) in component.imports() {
-            log::debug!("adding dependency for argument `{name}` (import index {import}) from instance `{instance_name}` to the queue", import = import.0);
+            log::debug!(
+                "adding dependency for argument `{name}` (import index {import}) from instance `{instance_name}` to the queue",
+                import = import.0
+            );
 
             // Search for a matching definition export for this import
             for (index, (def_component_id, _)) in self.definitions.iter().enumerate() {
diff --git a/crates/wasm-compose/src/config.rs b/crates/wasm-compose/src/config.rs
index 84f1df67..0803a7b7 100644
--- a/crates/wasm-compose/src/config.rs
+++ b/crates/wasm-compose/src/config.rs
@@ -144,8 +144,8 @@ impl Config {
 mod de {
     use indexmap::IndexMap;
     use serde::{
-        de::{self, MapAccess, Visitor},
         Deserialize, Deserializer,
+        de::{self, MapAccess, Visitor},
     };
     use std::{fmt, hash::Hash, marker::PhantomData, str::FromStr};
 
diff --git a/crates/wasm-compose/src/encoding.rs b/crates/wasm-compose/src/encoding.rs
index 82c0c515..179be51b 100644
--- a/crates/wasm-compose/src/encoding.rs
+++ b/crates/wasm-compose/src/encoding.rs
@@ -1,14 +1,15 @@
 use crate::graph::{
-    type_desc, CompositionGraph, EncodeOptions, ExportIndex, ImportIndex, InstanceId,
+    CompositionGraph, EncodeOptions, ExportIndex, ImportIndex, InstanceId, type_desc,
 };
-use anyhow::{anyhow, bail, Result};
+use anyhow::{Result, anyhow, bail};
 use indexmap::{IndexMap, IndexSet};
 use petgraph::EdgeDirection;
 use smallvec::SmallVec;
-use std::collections::{hash_map::Entry, HashMap};
+use std::collections::{HashMap, hash_map::Entry};
 use std::mem;
 use wasm_encoder::*;
 use wasmparser::{
+    ComponentExternalKind,
     component_types::{
         self as ct, AnyTypeId, ComponentAnyTypeId, ComponentCoreModuleTypeId, ComponentCoreTypeId,
         ComponentDefinedType, ComponentDefinedTypeId, ComponentEntityType, ComponentFuncTypeId,
@@ -16,7 +17,7 @@ use wasmparser::{
         SubtypeCx, TupleType, VariantType,
     },
     names::KebabString,
-    types, ComponentExternalKind,
+    types,
 };
 
 fn type_ref_to_export_kind(ty: wasmparser::ComponentTypeRef) -> ComponentExportKind {
@@ -605,17 +606,17 @@ impl<'a> TypeEncoder<'a> {
         return match id {
             AnyTypeId::Core(ComponentCoreTypeId::Sub(_)) => unreachable!(),
             AnyTypeId::Core(ComponentCoreTypeId::Module(id)) => self.module_type(state, id),
-            AnyTypeId::Component(id) => {
-                match id {
-                    ComponentAnyTypeId::Resource(r) => {
-                        unreachable!("should have been handled in `TypeEncoder::component_entity_type`: {r:?}")
-                    }
-                    ComponentAnyTypeId::Defined(id) => self.defined_type(state, id),
-                    ComponentAnyTypeId::Func(id) => self.component_func_type(state, id),
-                    ComponentAnyTypeId::Instance(id) => self.component_instance_type(state, id),
-                    ComponentAnyTypeId::Component(id) => self.component_type(state, id),
+            AnyTypeId::Component(id) => match id {
+                ComponentAnyTypeId::Resource(r) => {
+                    unreachable!(
+                        "should have been handled in `TypeEncoder::component_entity_type`: {r:?}"
+                    )
                 }
-            }
+                ComponentAnyTypeId::Defined(id) => self.defined_type(state, id),
+                ComponentAnyTypeId::Func(id) => self.component_func_type(state, id),
+                ComponentAnyTypeId::Instance(id) => self.component_instance_type(state, id),
+                ComponentAnyTypeId::Component(id) => self.component_type(state, id),
+            },
         };
     }
 
@@ -1017,13 +1018,14 @@ impl<'a> ImportMap<'a> {
             .values()
             .filter(|e| !e.instances.is_empty())
         {
-            assert!(self
-                .0
-                .insert(
-                    &entry.component.name,
-                    ImportMapEntry::Component(&entry.component),
-                )
-                .is_none());
+            assert!(
+                self.0
+                    .insert(
+                        &entry.component.name,
+                        ImportMapEntry::Component(&entry.component),
+                    )
+                    .is_none()
+            );
         }
     }
 
@@ -1087,10 +1089,10 @@ impl<'a> ImportMap<'a> {
                             indexmap::map::Entry::Occupied(mut e) => match e.get_mut() {
                                 ImportMapEntry::Component(_) => {
                                     bail!(
-                                            "cannot import {ty} `{name}` for an instantiation argument of component `{cname}` because it conflicts with a component imported with the same name",
-                                            ty = type_desc(ty),
-                                            cname = entry.component.name,
-                                        );
+                                        "cannot import {ty} `{name}` for an instantiation argument of component `{cname}` because it conflicts with a component imported with the same name",
+                                        ty = type_desc(ty),
+                                        cname = entry.component.name,
+                                    );
                                 }
                                 ImportMapEntry::Argument(existing) => {
                                     existing.merge(arg, remapping)?;
@@ -1410,10 +1412,11 @@ impl<'a> CompositionGraphEncoder<'a> {
         let type_index = self.define_component_type(encoded, component);
         let index = self.import(encoded, name, ComponentTypeRef::Component(type_index));
 
-        assert!(self
-            .encoded_components
-            .insert(PtrKey(component), index)
-            .is_none());
+        assert!(
+            self.encoded_components
+                .insert(PtrKey(component), index)
+                .is_none()
+        );
 
         index
     }
@@ -1572,10 +1575,11 @@ impl<'a> CompositionGraphEncoder<'a> {
             .filter(|e| !e.instances.is_empty())
         {
             let index = self.define_component(encoded, &entry.component);
-            assert!(self
-                .encoded_components
-                .insert(PtrKey(&entry.component), index)
-                .is_none());
+            assert!(
+                self.encoded_components
+                    .insert(PtrKey(&entry.component), index)
+                    .is_none()
+            );
         }
     }
 
diff --git a/crates/wasm-compose/src/graph.rs b/crates/wasm-compose/src/graph.rs
index a1c18799..1769b023 100644
--- a/crates/wasm-compose/src/graph.rs
+++ b/crates/wasm-compose/src/graph.rs
@@ -1,24 +1,24 @@
 //! Module for WebAssembly composition graphs.
 use crate::encoding::{CompositionGraphEncoder, TypeEncoder};
-use anyhow::{anyhow, bail, Context, Result};
+use anyhow::{Context, Result, anyhow, bail};
 use indexmap::{IndexMap, IndexSet};
-use petgraph::{algo::toposort, graphmap::DiGraphMap, EdgeDirection};
+use petgraph::{EdgeDirection, algo::toposort, graphmap::DiGraphMap};
 use std::{
     borrow::Cow,
     cell::RefCell,
-    collections::{hash_map::Entry, HashMap, HashSet},
+    collections::{HashMap, HashSet, hash_map::Entry},
     path::{Path, PathBuf},
     sync::atomic::{AtomicUsize, Ordering},
 };
 use wasmparser::{
+    Chunk, ComponentExternalKind, ComponentTypeRef, Encoding, Parser, Payload, ValidPayload,
+    Validator,
     component_types::{
         ComponentAnyTypeId, ComponentEntityType, ComponentInstanceTypeId, Remap, Remapping,
         ResourceId, SubtypeCx,
     },
     names::ComponentName,
     types::{Types, TypesRef},
-    Chunk, ComponentExternalKind, ComponentTypeRef, Encoding, Parser, Payload, ValidPayload,
-    Validator,
 };
 
 pub(crate) fn type_desc(item: ComponentEntityType) -> &'static str {
@@ -867,8 +867,12 @@ impl<'a> CompositionGraph<'a> {
         let target_import = target_import.into();
 
         match source_export {
-            Some(export) => log::info!("connecting export {export} of instance {source} to import `{target_import}` of instance {target}"),
-            None => log::info!("connecting instance {source} to import {target_import} of instance {target}"),
+            Some(export) => log::info!(
+                "connecting export {export} of instance {source} to import `{target_import}` of instance {target}"
+            ),
+            None => log::info!(
+                "connecting instance {source} to import {target_import} of instance {target}"
+            ),
         }
 
         self.instances
@@ -1067,9 +1071,16 @@ mod test {
     #[test]
     fn it_rejects_invalid_components() -> Result<()> {
         let mut validator = Validator::new();
-        match Component::from_bytes(&mut validator, "a", b"(component (export \"x\" (func 0)))".as_ref()) {
+        match Component::from_bytes(
+            &mut validator,
+            "a",
+            b"(component (export \"x\" (func 0)))".as_ref(),
+        ) {
             Ok(_) => panic!("expected a failure to parse"),
-            Err(e) => assert_eq!(format!("{e:#}"), "failed to parse component: unknown function 0: function index out of bounds (at offset 0xb)"),
+            Err(e) => assert_eq!(
+                format!("{e:#}"),
+                "failed to parse component: unknown function 0: function index out of bounds (at offset 0xb)"
+            ),
         }
 
         Ok(())
@@ -1375,7 +1386,10 @@ mod test {
             validate: true,
         }) {
             Ok(_) => panic!("graph should not encode"),
-            Err(e) => assert_eq!(format!("{e:#}"), "an instantiation of component `b` and its dependencies form a cycle in the instantiation graph"),
+            Err(e) => assert_eq!(
+                format!("{e:#}"),
+                "an instantiation of component `b` and its dependencies form a cycle in the instantiation graph"
+            ),
         }
 
         Ok(())
diff --git a/crates/wasm-encoder/src/component/aliases.rs b/crates/wasm-encoder/src/component/aliases.rs
index 07a93d07..95f6c048 100644
--- a/crates/wasm-encoder/src/component/aliases.rs
+++ b/crates/wasm-encoder/src/component/aliases.rs
@@ -1,6 +1,6 @@
 use super::{COMPONENT_SORT, CORE_MODULE_SORT, CORE_SORT, CORE_TYPE_SORT, TYPE_SORT};
 use crate::{
-    encode_section, ComponentExportKind, ComponentSection, ComponentSectionId, Encode, ExportKind,
+    ComponentExportKind, ComponentSection, ComponentSectionId, Encode, ExportKind, encode_section,
 };
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/component/canonicals.rs b/crates/wasm-encoder/src/component/canonicals.rs
index 2d4877c9..8724a1dd 100644
--- a/crates/wasm-encoder/src/component/canonicals.rs
+++ b/crates/wasm-encoder/src/component/canonicals.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, ComponentSection, ComponentSectionId, ComponentValType, Encode};
+use crate::{ComponentSection, ComponentSectionId, ComponentValType, Encode, encode_section};
 use alloc::vec::Vec;
 
 /// Represents options for canonical function definitions.
diff --git a/crates/wasm-encoder/src/component/exports.rs b/crates/wasm-encoder/src/component/exports.rs
index 314f9b31..ef4745bd 100644
--- a/crates/wasm-encoder/src/component/exports.rs
+++ b/crates/wasm-encoder/src/component/exports.rs
@@ -2,7 +2,7 @@ use super::{
     COMPONENT_SORT, CORE_MODULE_SORT, CORE_SORT, FUNCTION_SORT, INSTANCE_SORT, TYPE_SORT,
     VALUE_SORT,
 };
-use crate::{encode_section, ComponentSection, ComponentSectionId, ComponentTypeRef, Encode};
+use crate::{ComponentSection, ComponentSectionId, ComponentTypeRef, Encode, encode_section};
 use alloc::vec::Vec;
 
 /// Represents the kind of an export from a WebAssembly component.
diff --git a/crates/wasm-encoder/src/component/imports.rs b/crates/wasm-encoder/src/component/imports.rs
index c47baa34..4134ac54 100644
--- a/crates/wasm-encoder/src/component/imports.rs
+++ b/crates/wasm-encoder/src/component/imports.rs
@@ -1,6 +1,6 @@
 use crate::{
-    encode_section, ComponentExportKind, ComponentSection, ComponentSectionId, ComponentValType,
-    Encode,
+    ComponentExportKind, ComponentSection, ComponentSectionId, ComponentValType, Encode,
+    encode_section,
 };
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/component/instances.rs b/crates/wasm-encoder/src/component/instances.rs
index c7f26987..ac3aaf9b 100644
--- a/crates/wasm-encoder/src/component/instances.rs
+++ b/crates/wasm-encoder/src/component/instances.rs
@@ -1,6 +1,6 @@
 use super::CORE_INSTANCE_SORT;
 use crate::{
-    encode_section, ComponentExportKind, ComponentSection, ComponentSectionId, Encode, ExportKind,
+    ComponentExportKind, ComponentSection, ComponentSectionId, Encode, ExportKind, encode_section,
 };
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/component/names.rs b/crates/wasm-encoder/src/component/names.rs
index ee57d91c..84672714 100644
--- a/crates/wasm-encoder/src/component/names.rs
+++ b/crates/wasm-encoder/src/component/names.rs
@@ -2,7 +2,7 @@ use alloc::borrow::Cow;
 use alloc::vec::Vec;
 
 use super::*;
-use crate::{encoding_size, ExportKind, NameMap, SectionId};
+use crate::{ExportKind, NameMap, SectionId, encoding_size};
 
 /// Encoding for the `component-name` custom section which assigns
 /// human-readable names to items within a component.
diff --git a/crates/wasm-encoder/src/component/types.rs b/crates/wasm-encoder/src/component/types.rs
index 656f7134..980d7701 100644
--- a/crates/wasm-encoder/src/component/types.rs
+++ b/crates/wasm-encoder/src/component/types.rs
@@ -1,7 +1,7 @@
 use super::CORE_TYPE_SORT;
 use crate::{
-    encode_section, Alias, ComponentExportKind, ComponentOuterAliasKind, ComponentSection,
-    ComponentSectionId, ComponentTypeRef, CoreTypeEncoder, Encode, EntityType, ValType,
+    Alias, ComponentExportKind, ComponentOuterAliasKind, ComponentSection, ComponentSectionId,
+    ComponentTypeRef, CoreTypeEncoder, Encode, EntityType, ValType, encode_section,
 };
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/core/code.rs b/crates/wasm-encoder/src/core/code.rs
index 8c0f904c..92923512 100644
--- a/crates/wasm-encoder/src/core/code.rs
+++ b/crates/wasm-encoder/src/core/code.rs
@@ -1,5 +1,5 @@
 use crate::{
-    encode_section, Encode, HeapType, InstructionSink, RefType, Section, SectionId, ValType,
+    Encode, HeapType, InstructionSink, RefType, Section, SectionId, ValType, encode_section,
 };
 use alloc::borrow::Cow;
 use alloc::vec;
diff --git a/crates/wasm-encoder/src/core/custom.rs b/crates/wasm-encoder/src/core/custom.rs
index 55201155..45517e39 100644
--- a/crates/wasm-encoder/src/core/custom.rs
+++ b/crates/wasm-encoder/src/core/custom.rs
@@ -1,4 +1,4 @@
-use crate::{encoding_size, Encode, Section, SectionId};
+use crate::{Encode, Section, SectionId, encoding_size};
 use alloc::borrow::Cow;
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/core/data.rs b/crates/wasm-encoder/src/core/data.rs
index 9d7ac752..c57678f5 100644
--- a/crates/wasm-encoder/src/core/data.rs
+++ b/crates/wasm-encoder/src/core/data.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, encoding_size, ConstExpr, Encode, Section, SectionId};
+use crate::{ConstExpr, Encode, Section, SectionId, encode_section, encoding_size};
 use alloc::vec::Vec;
 
 /// An encoder for the data section.
diff --git a/crates/wasm-encoder/src/core/elements.rs b/crates/wasm-encoder/src/core/elements.rs
index b3a3b513..4138d645 100644
--- a/crates/wasm-encoder/src/core/elements.rs
+++ b/crates/wasm-encoder/src/core/elements.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, ConstExpr, Encode, RefType, Section, SectionId};
+use crate::{ConstExpr, Encode, RefType, Section, SectionId, encode_section};
 use alloc::borrow::Cow;
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/core/exports.rs b/crates/wasm-encoder/src/core/exports.rs
index a9422952..3208f257 100644
--- a/crates/wasm-encoder/src/core/exports.rs
+++ b/crates/wasm-encoder/src/core/exports.rs
@@ -1,7 +1,7 @@
 use super::{
     CORE_FUNCTION_SORT, CORE_GLOBAL_SORT, CORE_MEMORY_SORT, CORE_TABLE_SORT, CORE_TAG_SORT,
 };
-use crate::{encode_section, Encode, Section, SectionId};
+use crate::{Encode, Section, SectionId, encode_section};
 use alloc::vec::Vec;
 
 /// Represents the kind of an export from a WebAssembly module.
diff --git a/crates/wasm-encoder/src/core/functions.rs b/crates/wasm-encoder/src/core/functions.rs
index 063b4895..b0df44dc 100644
--- a/crates/wasm-encoder/src/core/functions.rs
+++ b/crates/wasm-encoder/src/core/functions.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, Encode, Section, SectionId};
+use crate::{Encode, Section, SectionId, encode_section};
 use alloc::vec::Vec;
 
 /// An encoder for the function section of WebAssembly modules.
diff --git a/crates/wasm-encoder/src/core/globals.rs b/crates/wasm-encoder/src/core/globals.rs
index ae1ba878..5e3873f2 100644
--- a/crates/wasm-encoder/src/core/globals.rs
+++ b/crates/wasm-encoder/src/core/globals.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, ConstExpr, Encode, Section, SectionId, ValType};
+use crate::{ConstExpr, Encode, Section, SectionId, ValType, encode_section};
 use alloc::vec::Vec;
 
 /// An encoder for the global section.
diff --git a/crates/wasm-encoder/src/core/imports.rs b/crates/wasm-encoder/src/core/imports.rs
index 7db71ba4..ac9271f1 100644
--- a/crates/wasm-encoder/src/core/imports.rs
+++ b/crates/wasm-encoder/src/core/imports.rs
@@ -1,6 +1,6 @@
 use crate::{
-    encode_section, Encode, GlobalType, MemoryType, Section, SectionId, TableType, TagType,
-    CORE_FUNCTION_SORT, CORE_GLOBAL_SORT, CORE_MEMORY_SORT, CORE_TABLE_SORT, CORE_TAG_SORT,
+    CORE_FUNCTION_SORT, CORE_GLOBAL_SORT, CORE_MEMORY_SORT, CORE_TABLE_SORT, CORE_TAG_SORT, Encode,
+    GlobalType, MemoryType, Section, SectionId, TableType, TagType, encode_section,
 };
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/core/instructions.rs b/crates/wasm-encoder/src/core/instructions.rs
index f38210e7..8ae2fcb7 100644
--- a/crates/wasm-encoder/src/core/instructions.rs
+++ b/crates/wasm-encoder/src/core/instructions.rs
@@ -1,8 +1,8 @@
 #[allow(unused_imports)]
 use crate::Instruction;
 use crate::{
-    encode_vec, BlockType, Catch, Encode, Handle, HeapType, Ieee32, Ieee64, Lane, MemArg, Ordering,
-    RefType, ValType,
+    BlockType, Catch, Encode, Handle, HeapType, Ieee32, Ieee64, Lane, MemArg, Ordering, RefType,
+    ValType, encode_vec,
 };
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/core/linking.rs b/crates/wasm-encoder/src/core/linking.rs
index e75034c9..a4488d75 100644
--- a/crates/wasm-encoder/src/core/linking.rs
+++ b/crates/wasm-encoder/src/core/linking.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, CustomSection, Encode, Section, SectionId};
+use crate::{CustomSection, Encode, Section, SectionId, encode_section};
 use alloc::borrow::Cow;
 use alloc::vec;
 use alloc::vec::Vec;
diff --git a/crates/wasm-encoder/src/core/memories.rs b/crates/wasm-encoder/src/core/memories.rs
index 40395306..d678fc64 100644
--- a/crates/wasm-encoder/src/core/memories.rs
+++ b/crates/wasm-encoder/src/core/memories.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, Encode, Section, SectionId};
+use crate::{Encode, Section, SectionId, encode_section};
 use alloc::vec::Vec;
 
 /// An encoder for the memory section.
diff --git a/crates/wasm-encoder/src/core/names.rs b/crates/wasm-encoder/src/core/names.rs
index b3b96c81..1b91a6fb 100644
--- a/crates/wasm-encoder/src/core/names.rs
+++ b/crates/wasm-encoder/src/core/names.rs
@@ -1,4 +1,4 @@
-use crate::{encoding_size, CustomSection, Encode, Section, SectionId};
+use crate::{CustomSection, Encode, Section, SectionId, encoding_size};
 use alloc::borrow::Cow;
 use alloc::vec;
 use alloc::vec::Vec;
diff --git a/crates/wasm-encoder/src/core/start.rs b/crates/wasm-encoder/src/core/start.rs
index 22294a19..e4a04cd5 100644
--- a/crates/wasm-encoder/src/core/start.rs
+++ b/crates/wasm-encoder/src/core/start.rs
@@ -1,4 +1,4 @@
-use crate::{encoding_size, Encode, Section, SectionId};
+use crate::{Encode, Section, SectionId, encoding_size};
 use alloc::vec::Vec;
 
 /// An encoder for the start section of WebAssembly modules.
diff --git a/crates/wasm-encoder/src/core/tables.rs b/crates/wasm-encoder/src/core/tables.rs
index 6df54bc1..ac9094f0 100644
--- a/crates/wasm-encoder/src/core/tables.rs
+++ b/crates/wasm-encoder/src/core/tables.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, ConstExpr, Encode, RefType, Section, SectionId, ValType};
+use crate::{ConstExpr, Encode, RefType, Section, SectionId, ValType, encode_section};
 use alloc::vec::Vec;
 
 /// An encoder for the table section.
diff --git a/crates/wasm-encoder/src/core/tags.rs b/crates/wasm-encoder/src/core/tags.rs
index 008d40eb..41b6f467 100644
--- a/crates/wasm-encoder/src/core/tags.rs
+++ b/crates/wasm-encoder/src/core/tags.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, Encode, Section, SectionId};
+use crate::{Encode, Section, SectionId, encode_section};
 use alloc::vec::Vec;
 
 /// An encoder for the tag section.
diff --git a/crates/wasm-encoder/src/core/types.rs b/crates/wasm-encoder/src/core/types.rs
index a12d82cf..a84ffd3f 100644
--- a/crates/wasm-encoder/src/core/types.rs
+++ b/crates/wasm-encoder/src/core/types.rs
@@ -1,4 +1,4 @@
-use crate::{encode_section, Encode, Section, SectionId};
+use crate::{Encode, Section, SectionId, encode_section};
 use alloc::boxed::Box;
 use alloc::vec::Vec;
 
diff --git a/crates/wasm-encoder/src/reencode.rs b/crates/wasm-encoder/src/reencode.rs
index 58f3c1e5..46f87d98 100644
--- a/crates/wasm-encoder/src/reencode.rs
+++ b/crates/wasm-encoder/src/reencode.rs
@@ -692,7 +692,7 @@ pub mod utils {
                     ..
                 } => (),
                 wasmparser::Payload::Version { .. } => {
-                    return Err(Error::UnexpectedNonCoreModuleSection)
+                    return Err(Error::UnexpectedNonCoreModuleSection);
                 }
                 wasmparser::Payload::TypeSection(section) => {
                     handle_intersperse_section_hook(
@@ -864,7 +864,7 @@ pub mod utils {
                 | wasmparser::Payload::ComponentStartSection { .. }
                 | wasmparser::Payload::ComponentImportSection(_)
                 | wasmparser::Payload::ComponentExportSection(_) => {
-                    return Err(Error::UnexpectedNonCoreModuleSection)
+                    return Err(Error::UnexpectedNonCoreModuleSection);
                 }
                 wasmparser::Payload::CustomSection(section) => {
                     reencoder.parse_custom_section(module, section)?;
diff --git a/crates/wasm-metadata/src/add_metadata.rs b/crates/wasm-metadata/src/add_metadata.rs
index 7fd98ef3..c5c65bf4 100644
--- a/crates/wasm-metadata/src/add_metadata.rs
+++ b/crates/wasm-metadata/src/add_metadata.rs
@@ -1,4 +1,4 @@
-use crate::{rewrite_wasm, Producers};
+use crate::{Producers, rewrite_wasm};
 use anyhow::Result;
 use std::fmt::Debug;
 
diff --git a/crates/wasm-metadata/src/dependencies.rs b/crates/wasm-metadata/src/dependencies.rs
index 51e08ca9..79ea85e7 100644
--- a/crates/wasm-metadata/src/dependencies.rs
+++ b/crates/wasm-metadata/src/dependencies.rs
@@ -1,11 +1,11 @@
 use std::fmt::{self, Display};
-use std::io::{read_to_string, Read};
+use std::io::{Read, read_to_string};
 use std::str::FromStr;
 
-use anyhow::{ensure, Result};
+use anyhow::{Result, ensure};
 use auditable_serde::VersionInfo;
-use flate2::read::{ZlibDecoder, ZlibEncoder};
 use flate2::Compression;
+use flate2::read::{ZlibDecoder, ZlibEncoder};
 use serde::Serialize;
 use wasm_encoder::{ComponentSection, CustomSection, Encode, Section};
 use wasmparser::CustomSectionReader;
diff --git a/crates/wasm-metadata/src/oci_annotations/authors.rs b/crates/wasm-metadata/src/oci_annotations/authors.rs
index 8cfa107e..a506356b 100644
--- a/crates/wasm-metadata/src/oci_annotations/authors.rs
+++ b/crates/wasm-metadata/src/oci_annotations/authors.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
 use std::fmt::{self, Display};
 use std::str::FromStr;
 
-use anyhow::{ensure, Error, Result};
+use anyhow::{Error, Result, ensure};
 use serde::Serialize;
 use wasm_encoder::{ComponentSection, CustomSection, Encode, Section};
 use wasmparser::CustomSectionReader;
diff --git a/crates/wasm-metadata/src/oci_annotations/description.rs b/crates/wasm-metadata/src/oci_annotations/description.rs
index 43dfcfd0..8d63efb3 100644
--- a/crates/wasm-metadata/src/oci_annotations/description.rs
+++ b/crates/wasm-metadata/src/oci_annotations/description.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
 use std::fmt::{self, Display};
 use std::str::FromStr;
 
-use anyhow::{ensure, Error, Result};
+use anyhow::{Error, Result, ensure};
 use serde::Serialize;
 use wasm_encoder::{ComponentSection, CustomSection, Encode, Section};
 use wasmparser::CustomSectionReader;
diff --git a/crates/wasm-metadata/src/oci_annotations/homepage.rs b/crates/wasm-metadata/src/oci_annotations/homepage.rs
index ab26ea27..8c9a1238 100644
--- a/crates/wasm-metadata/src/oci_annotations/homepage.rs
+++ b/crates/wasm-metadata/src/oci_annotations/homepage.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
 use std::fmt::{self, Display};
 use std::str::FromStr;
 
-use anyhow::{ensure, Error, Result};
+use anyhow::{Error, Result, ensure};
 use serde::Serialize;
 use url::Url;
 use wasm_encoder::{ComponentSection, CustomSection, Encode, Section};
diff --git a/crates/wasm-metadata/src/oci_annotations/licenses.rs b/crates/wasm-metadata/src/oci_annotations/licenses.rs
index 6dc530b1..dbdd41f4 100644
--- a/crates/wasm-metadata/src/oci_annotations/licenses.rs
+++ b/crates/wasm-metadata/src/oci_annotations/licenses.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
 use std::fmt::{self, Display};
 use std::str::FromStr;
 
-use anyhow::{ensure, Error, Result};
+use anyhow::{Error, Result, ensure};
 use serde::Serialize;
 use wasm_encoder::{ComponentSection, CustomSection, Encode, Section};
 use wasmparser::CustomSectionReader;
diff --git a/crates/wasm-metadata/src/oci_annotations/revision.rs b/crates/wasm-metadata/src/oci_annotations/revision.rs
index a70c4344..a4fbef60 100644
--- a/crates/wasm-metadata/src/oci_annotations/revision.rs
+++ b/crates/wasm-metadata/src/oci_annotations/revision.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
 use std::fmt::{self, Display};
 use std::str::FromStr;
 
-use anyhow::{ensure, Error, Result};
+use anyhow::{Error, Result, ensure};
 use serde::Serialize;
 use wasm_encoder::{ComponentSection, CustomSection, Encode, Section};
 use wasmparser::CustomSectionReader;
diff --git a/crates/wasm-metadata/src/oci_annotations/source.rs b/crates/wasm-metadata/src/oci_annotations/source.rs
index 8c25b444..71a4a7bd 100644
--- a/crates/wasm-metadata/src/oci_annotations/source.rs
+++ b/crates/wasm-metadata/src/oci_annotations/source.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
 use std::fmt::{self, Display};
 use std::str::FromStr;
 
-use anyhow::{ensure, Error, Result};
+use anyhow::{Error, Result, ensure};
 use serde::Serialize;
 use url::Url;
 use wasm_encoder::{ComponentSection, CustomSection, Encode, Section};
diff --git a/crates/wasm-metadata/src/oci_annotations/version.rs b/crates/wasm-metadata/src/oci_annotations/version.rs
index 290a30db..818fd54a 100644
--- a/crates/wasm-metadata/src/oci_annotations/version.rs
+++ b/crates/wasm-metadata/src/oci_annotations/version.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
 use std::fmt::{self, Display};
 use std::str::FromStr;
 
-use anyhow::{ensure, Error, Result};
+use anyhow::{Error, Result, ensure};
 use serde::Serialize;
 use wasm_encoder::{ComponentSection, CustomSection, Encode, Section};
 use wasmparser::CustomSectionReader;
diff --git a/crates/wasm-metadata/src/producers.rs b/crates/wasm-metadata/src/producers.rs
index 117c5078..5a5f7937 100644
--- a/crates/wasm-metadata/src/producers.rs
+++ b/crates/wasm-metadata/src/producers.rs
@@ -1,9 +1,9 @@
 use anyhow::Result;
-use indexmap::{map::Entry, IndexMap};
+use indexmap::{IndexMap, map::Entry};
 use wasm_encoder::Encode;
 use wasmparser::{BinaryReader, KnownCustom, Parser, ProducersSectionReader};
 
-use crate::{rewrite_wasm, AddMetadata};
+use crate::{AddMetadata, rewrite_wasm};
 /// A representation of a WebAssembly producers section.
 ///
 /// Spec: <https://github.com/WebAssembly/tool-conventions/blob/main/ProducersSection.md>
diff --git a/crates/wasm-mutate-stats/src/bin/wasm-mutate-stats.rs b/crates/wasm-mutate-stats/src/bin/wasm-mutate-stats.rs
index 7e3da6fa..e79a8e34 100644
--- a/crates/wasm-mutate-stats/src/bin/wasm-mutate-stats.rs
+++ b/crates/wasm-mutate-stats/src/bin/wasm-mutate-stats.rs
@@ -2,14 +2,14 @@ use anyhow::Context;
 use clap::Parser;
 use core::sync::atomic::Ordering::{Relaxed, SeqCst};
 use rand::Rng;
-use rand::{rngs::SmallRng, SeedableRng};
+use rand::{SeedableRng, rngs::SmallRng};
 use std::collections::hash_map::DefaultHasher;
 use std::ffi::OsStr;
 use std::fmt::Display;
 use std::hash::{Hash, Hasher};
 use std::path::{Path, PathBuf};
-use std::sync::atomic::AtomicBool;
 use std::sync::Mutex;
+use std::sync::atomic::AtomicBool;
 use std::time::Duration;
 use std::{collections::HashMap, sync::Arc};
 use std::{panic, process};
@@ -515,7 +515,10 @@ impl State {
                         // Saving report
                         let h1 = self.hash(&wasm);
                         self.save_crash(&wasm, None, seed, artifact_folder)?;
-                        anyhow::bail!(format!("Mutation invalid for entry {} seed {}.\n Crashing wasm is saved at crashes folder with name '<seed>.original.wasm'", h1, seed))
+                        anyhow::bail!(format!(
+                            "Mutation invalid for entry {} seed {}.\n Crashing wasm is saved at crashes folder with name '<seed>.original.wasm'",
+                            h1, seed
+                        ))
                     }
                 },
             };
diff --git a/crates/wasm-mutate/src/info.rs b/crates/wasm-mutate/src/info.rs
index 28fcabb3..06c20f89 100644
--- a/crates/wasm-mutate/src/info.rs
+++ b/crates/wasm-mutate/src/info.rs
@@ -1,6 +1,6 @@
 use crate::{
-    module::{PrimitiveTypeInfo, TypeInfo},
     Error, Result,
+    module::{PrimitiveTypeInfo, TypeInfo},
 };
 use std::collections::HashSet;
 use std::ops::Range;
diff --git a/crates/wasm-mutate/src/lib.rs b/crates/wasm-mutate/src/lib.rs
index 2fbb781a..ff7bf001 100644
--- a/crates/wasm-mutate/src/lib.rs
+++ b/crates/wasm-mutate/src/lib.rs
@@ -17,17 +17,17 @@ mod mutators;
 pub use error::*;
 
 use crate::mutators::{
-    add_function::AddFunctionMutator, add_type::AddTypeMutator, codemotion::CodemotionMutator,
-    custom::AddCustomSectionMutator, custom::CustomSectionMutator,
+    Item, add_function::AddFunctionMutator, add_type::AddTypeMutator,
+    codemotion::CodemotionMutator, custom::AddCustomSectionMutator, custom::CustomSectionMutator,
     custom::ReorderCustomSectionMutator, function_body_unreachable::FunctionBodyUnreachable,
     modify_const_exprs::ConstExpressionMutator, modify_data::ModifyDataMutator,
     peephole::PeepholeMutator, remove_export::RemoveExportMutator, remove_item::RemoveItemMutator,
     remove_section::RemoveSection, rename_export::RenameExportMutator, snip_function::SnipMutator,
-    start::RemoveStartSection, Item,
+    start::RemoveStartSection,
 };
 use info::ModuleInfo;
 use mutators::Mutator;
-use rand::{rngs::SmallRng, Rng, SeedableRng};
+use rand::{Rng, SeedableRng, rngs::SmallRng};
 use std::sync::Arc;
 
 #[cfg(feature = "clap")]
diff --git a/crates/wasm-mutate/src/mutators/add_type.rs b/crates/wasm-mutate/src/mutators/add_type.rs
index 3bbdbc40..aa3b9439 100644
--- a/crates/wasm-mutate/src/mutators/add_type.rs
+++ b/crates/wasm-mutate/src/mutators/add_type.rs
@@ -1,8 +1,8 @@
 //! A mutator to add a new type to a Wasm module.
 
 use super::Mutator;
-use crate::module::map_type;
 use crate::Result;
+use crate::module::map_type;
 use rand::Rng;
 use std::iter;
 
diff --git a/crates/wasm-mutate/src/mutators/codemotion.rs b/crates/wasm-mutate/src/mutators/codemotion.rs
index 3007f671..b4b0854a 100644
--- a/crates/wasm-mutate/src/mutators/codemotion.rs
+++ b/crates/wasm-mutate/src/mutators/codemotion.rs
@@ -22,16 +22,16 @@ pub mod loop_unrolling;
 use self::ir::parse_context::Ast;
 use super::Mutator;
 use crate::{
+    Error, Result, WasmMutate,
     module::map_type,
     mutators::{
+        OperatorAndByteOffset,
         codemotion::{
             if_complement::IfComplementMutator, ir::AstBuilder, loop_unrolling::LoopUnrollMutator,
         },
-        OperatorAndByteOffset,
     },
-    Error, Result, WasmMutate,
 };
-use rand::{prelude::SliceRandom, Rng};
+use rand::{Rng, prelude::SliceRandom};
 use wasm_encoder::{CodeSection, Function, Module, ValType};
 use wasmparser::{CodeSectionReader, FunctionBody};
 
@@ -167,7 +167,7 @@ impl Mutator for CodemotionMutator {
 
 #[cfg(test)]
 mod tests {
-    use crate::{mutators::codemotion::CodemotionMutator, WasmMutate};
+    use crate::{WasmMutate, mutators::codemotion::CodemotionMutator};
 
     fn test_motion_mutator(original: &str, expected: &str, seed: u64) {
         let mut config = WasmMutate::default();
diff --git a/crates/wasm-mutate/src/mutators/codemotion/if_complement.rs b/crates/wasm-mutate/src/mutators/codemotion/if_complement.rs
index 037caa67..733c2862 100644
--- a/crates/wasm-mutate/src/mutators/codemotion/if_complement.rs
+++ b/crates/wasm-mutate/src/mutators/codemotion/if_complement.rs
@@ -6,15 +6,15 @@ use rand::prelude::SliceRandom;
 use wasm_encoder::{Function, ValType};
 
 use crate::{
+    WasmMutate,
     module::map_block_type,
     mutators::{
+        OperatorAndByteOffset,
         codemotion::{
-            ir::{parse_context::Ast, AstWriter},
             AstMutator,
+            ir::{AstWriter, parse_context::Ast},
         },
-        OperatorAndByteOffset,
     },
-    WasmMutate,
 };
 
 /// This mutator selects a random `if` construction in a function and swap its branches.
diff --git a/crates/wasm-mutate/src/mutators/codemotion/ir.rs b/crates/wasm-mutate/src/mutators/codemotion/ir.rs
index 6ffd458c..fc04a88b 100644
--- a/crates/wasm-mutate/src/mutators/codemotion/ir.rs
+++ b/crates/wasm-mutate/src/mutators/codemotion/ir.rs
@@ -1,8 +1,8 @@
 //! Parsing and econding for code motion mutators.
 use crate::{
-    module::map_block_type,
-    mutators::{codemotion::ir::parse_context::ParseContext, OperatorAndByteOffset},
     Error,
+    module::map_block_type,
+    mutators::{OperatorAndByteOffset, codemotion::ir::parse_context::ParseContext},
 };
 use std::ops::Range;
 use wasm_encoder::Function;
diff --git a/crates/wasm-mutate/src/mutators/codemotion/loop_unrolling.rs b/crates/wasm-mutate/src/mutators/codemotion/loop_unrolling.rs
index f99e5e86..6672c8b8 100644
--- a/crates/wasm-mutate/src/mutators/codemotion/loop_unrolling.rs
+++ b/crates/wasm-mutate/src/mutators/codemotion/loop_unrolling.rs
@@ -7,18 +7,18 @@ use wasm_encoder::{Function, Instruction, ValType};
 use wasmparser::{BlockType, Operator};
 
 use crate::{
+    Error, WasmMutate,
     module::map_block_type,
     mutators::{
+        OperatorAndByteOffset,
         codemotion::{
+            AstMutator,
             ir::{
-                parse_context::{Ast, Node},
                 AstWriter,
+                parse_context::{Ast, Node},
             },
-            AstMutator,
         },
-        OperatorAndByteOffset,
     },
-    Error, WasmMutate,
 };
 
 /// This mutator selects a random `loop` construction in a function and tries to unroll it.
diff --git a/crates/wasm-mutate/src/mutators/custom.rs b/crates/wasm-mutate/src/mutators/custom.rs
index bf98f5ba..c9404706 100644
--- a/crates/wasm-mutate/src/mutators/custom.rs
+++ b/crates/wasm-mutate/src/mutators/custom.rs
@@ -3,7 +3,7 @@
 use std::borrow::Cow;
 
 use super::Mutator;
-use rand::{seq::SliceRandom, Rng};
+use rand::{Rng, seq::SliceRandom};
 
 #[derive(Clone, Copy)]
 pub struct CustomSectionMutator;
diff --git a/crates/wasm-mutate/src/mutators/peephole.rs b/crates/wasm-mutate/src/mutators/peephole.rs
index 6953fcfd..58e2224f 100644
--- a/crates/wasm-mutate/src/mutators/peephole.rs
+++ b/crates/wasm-mutate/src/mutators/peephole.rs
@@ -28,15 +28,15 @@ use self::{
     dfg::DFGBuilder,
     eggsy::{
         analysis::PeepholeMutationAnalysis,
-        encoder::{expr2wasm::ResourceRequest, Encoder},
+        encoder::{Encoder, expr2wasm::ResourceRequest},
         expr_enumerator::lazy_expand_aux,
         lang::*,
     },
 };
 use super::{Mutator, OperatorAndByteOffset};
 use crate::{
-    module::{map_type, PrimitiveTypeInfo},
     Error, ErrorKind, ModuleInfo, Result, WasmMutate,
+    module::{PrimitiveTypeInfo, map_type},
 };
 use egg::{Rewrite, Runner};
 use rand::Rng;
@@ -521,15 +521,15 @@ macro_rules! match_code_mutation {
 #[cfg(test)]
 mod tests {
     use crate::{
+        WasmMutate,
         info::ModuleInfo,
         module::PrimitiveTypeInfo,
-        mutators::{peephole::PeepholeMutator, Mutator},
-        WasmMutate,
+        mutators::{Mutator, peephole::PeepholeMutator},
     };
-    use egg::{rewrite, Id, Rewrite, Subst};
-    use rand::{rngs::SmallRng, SeedableRng};
+    use egg::{Id, Rewrite, Subst, rewrite};
+    use rand::{SeedableRng, rngs::SmallRng};
 
-    use super::{PeepholeMutationAnalysis, EG};
+    use super::{EG, PeepholeMutationAnalysis};
     use crate::mutators::peephole::Lang;
 
     /// Condition to apply the unfold operator
diff --git a/crates/wasm-mutate/src/mutators/peephole/dfg.rs b/crates/wasm-mutate/src/mutators/peephole/dfg.rs
index 686931c2..c02c96c1 100644
--- a/crates/wasm-mutate/src/mutators/peephole/dfg.rs
+++ b/crates/wasm-mutate/src/mutators/peephole/dfg.rs
@@ -2,10 +2,10 @@
 //! intermediate representation.
 
 use super::eggsy::encoder::rebuild::build_expr;
+use crate::mutators::OperatorAndByteOffset;
 use crate::mutators::peephole::{
     Lang, MemArg, MemArgLane, MemoryCopy, MemoryInit, RefType, Shuffle, TableCopy, TableInit,
 };
-use crate::mutators::OperatorAndByteOffset;
 use crate::{ModuleInfo, WasmMutate};
 use egg::{Id, Language, RecExpr};
 use std::collections::HashMap;
diff --git a/crates/wasm-mutate/src/mutators/peephole/eggsy/analysis.rs b/crates/wasm-mutate/src/mutators/peephole/eggsy/analysis.rs
index 9289e275..9e3b91a4 100644
--- a/crates/wasm-mutate/src/mutators/peephole/eggsy/analysis.rs
+++ b/crates/wasm-mutate/src/mutators/peephole/eggsy/analysis.rs
@@ -1,10 +1,10 @@
 use crate::{
+    Error, ModuleInfo,
     module::{PrimitiveTypeInfo, TypeInfo},
     mutators::peephole::{
-        eggsy::{lang::RefType, Lang},
         EG,
+        eggsy::{Lang, lang::RefType},
     },
-    Error, ModuleInfo,
 };
 use egg::{Analysis, EGraph, Id};
 
diff --git a/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder.rs b/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder.rs
index 46434439..590b23db 100644
--- a/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder.rs
+++ b/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder.rs
@@ -1,10 +1,10 @@
 //! Helper methods for encoding eterm expressions to Wasm and back
 
+use crate::WasmMutate;
 use crate::mutators::peephole::dfg::MiniDFG;
 use crate::mutators::peephole::eggsy::encoder::expr2wasm::expr2wasm;
-use crate::mutators::peephole::{dfg::BBlock, OperatorAndByteOffset};
-use crate::mutators::peephole::{Lang, EG};
-use crate::WasmMutate;
+use crate::mutators::peephole::{EG, Lang};
+use crate::mutators::peephole::{OperatorAndByteOffset, dfg::BBlock};
 use egg::RecExpr;
 
 use wasm_encoder::Function;
diff --git a/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/expr2wasm.rs b/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/expr2wasm.rs
index b7c0e64d..bf53adc4 100644
--- a/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/expr2wasm.rs
+++ b/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/expr2wasm.rs
@@ -1,9 +1,9 @@
 //! Helper to encode [Lang] expressions to Wasm.
 
 use crate::{
-    module::PrimitiveTypeInfo,
-    mutators::peephole::{eggsy::encoder::TraversalEvent, Lang, MemArg, EG},
     Error, Result, WasmMutate,
+    module::PrimitiveTypeInfo,
+    mutators::peephole::{EG, Lang, MemArg, eggsy::encoder::TraversalEvent},
 };
 use egg::{Id, Language, RecExpr};
 use rand::Rng;
@@ -155,7 +155,7 @@ pub fn expr2wasm(
                             _ => {
                                 return Err(Error::other(format!(
                                     "The current eterm cannot be unfolded {child:?}.\n expr {expr}"
-                                )))
+                                )));
                             }
                         }
                         insn
diff --git a/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/rebuild.rs b/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/rebuild.rs
index b6dbf08d..da25c9c3 100644
--- a/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/rebuild.rs
+++ b/crates/wasm-mutate/src/mutators/peephole/eggsy/encoder/rebuild.rs
@@ -1,8 +1,8 @@
 //! Function to construct expressions
 use std::collections::HashMap;
 
-use crate::mutators::peephole::eggsy::encoder::TraversalEvent;
 use crate::mutators::peephole::Lang;
+use crate::mutators::peephole::eggsy::encoder::TraversalEvent;
 use egg::{Id, Language, RecExpr};
 
 /// Build RecExpr from tree information
diff --git a/crates/wasm-mutate/src/mutators/peephole/eggsy/expr_enumerator.rs b/crates/wasm-mutate/src/mutators/peephole/eggsy/expr_enumerator.rs
index f5b9fead..c0c53643 100644
--- a/crates/wasm-mutate/src/mutators/peephole/eggsy/expr_enumerator.rs
+++ b/crates/wasm-mutate/src/mutators/peephole/eggsy/expr_enumerator.rs
@@ -5,11 +5,11 @@
 
 use super::lang::Lang;
 use crate::mutators::peephole::{
-    eggsy::{encoder::rebuild::build_expr_inner, RandomExtractor},
     EG,
+    eggsy::{RandomExtractor, encoder::rebuild::build_expr_inner},
 };
 use egg::{AstSize, Id, Language, RecExpr};
-use rand::{prelude::SmallRng, Rng, SeedableRng};
+use rand::{Rng, SeedableRng, prelude::SmallRng};
 use std::{cell::RefCell, rc::Rc};
 
 /// Returns a lazy iterator over all possible expressions that can be
@@ -180,12 +180,12 @@ pub fn lazy_expand_aux<'a>(
 
 #[cfg(test)]
 mod tests {
+    use crate::ModuleInfo;
     use crate::mutators::peephole::eggsy::{
         analysis::PeepholeMutationAnalysis, expr_enumerator::lazy_expand, lang::Lang,
     };
-    use crate::ModuleInfo;
-    use egg::{rewrite, AstSize, RecExpr, Rewrite, Runner};
-    use rand::{prelude::SmallRng, SeedableRng};
+    use egg::{AstSize, RecExpr, Rewrite, Runner, rewrite};
+    use rand::{SeedableRng, prelude::SmallRng};
     use std::{cell::RefCell, collections::HashMap, rc::Rc};
 
     #[derive(Clone, Copy, Debug)]
diff --git a/crates/wasm-mutate/src/mutators/peephole/rules.rs b/crates/wasm-mutate/src/mutators/peephole/rules.rs
index f795f4a3..9bd90037 100644
--- a/crates/wasm-mutate/src/mutators/peephole/rules.rs
+++ b/crates/wasm-mutate/src/mutators/peephole/rules.rs
@@ -3,13 +3,13 @@
 //! New rewriting rules should be declared inside the
 //! [`get_rules`](/src/wasm_mutate/mutators/peephole/rules.rs.html#17) function.
 
-use egg::{rewrite, Id, Rewrite, Subst};
+use egg::{Id, Rewrite, Subst, rewrite};
 
-use crate::{module::PrimitiveTypeInfo, WasmMutate};
+use crate::{WasmMutate, module::PrimitiveTypeInfo};
 
 use super::{
+    EG, PeepholeMutator,
     eggsy::{analysis::PeepholeMutationAnalysis, lang::Lang},
-    PeepholeMutator, EG,
 };
 
 impl PeepholeMutator {
diff --git a/crates/wasm-shrink/src/lib.rs b/crates/wasm-shrink/src/lib.rs
index 06e24a30..2505c9ca 100755
--- a/crates/wasm-shrink/src/lib.rs
+++ b/crates/wasm-shrink/src/lib.rs
@@ -4,7 +4,7 @@
 //! See the [`WasmShrink`] type for details.
 
 use anyhow::{Context, Result};
-use rand::{rngs::SmallRng, Rng, SeedableRng};
+use rand::{Rng, SeedableRng, rngs::SmallRng};
 use std::collections::HashSet;
 use wasm_mutate::WasmMutate;
 use wasmparser::WasmFeatures;
diff --git a/crates/wasm-smith/benches/corpus.rs b/crates/wasm-smith/benches/corpus.rs
index 56206c69..c214eaf3 100644
--- a/crates/wasm-smith/benches/corpus.rs
+++ b/crates/wasm-smith/benches/corpus.rs
@@ -1,5 +1,5 @@
 use arbitrary::{Arbitrary, Unstructured};
-use criterion::{black_box, criterion_group, criterion_main, Criterion};
+use criterion::{Criterion, black_box, criterion_group, criterion_main};
 use wasm_smith::Module;
 
 pub fn benchmark_corpus(c: &mut Criterion) {
diff --git a/crates/wasm-smith/src/component.rs b/crates/wasm-smith/src/component.rs
index 667e241f..f957de63 100644
--- a/crates/wasm-smith/src/component.rs
+++ b/crates/wasm-smith/src/component.rs
@@ -4,7 +4,7 @@
 // FIXME(#1000): component support in `wasm-smith` is a work in progress.
 #![allow(unused_variables, dead_code)]
 
-use crate::{arbitrary_loop, Config};
+use crate::{Config, arbitrary_loop};
 use arbitrary::{Arbitrary, Result, Unstructured};
 use std::collections::BTreeMap;
 use std::{
diff --git a/crates/wasm-smith/src/core.rs b/crates/wasm-smith/src/core.rs
index 9f9fd495..a3792b22 100644
--- a/crates/wasm-smith/src/core.rs
+++ b/crates/wasm-smith/src/core.rs
@@ -4,10 +4,10 @@ mod code_builder;
 pub(crate) mod encode;
 mod terminate;
 
-use crate::{arbitrary_loop, limited_string, unique_string, Config};
+use crate::{Config, arbitrary_loop, limited_string, unique_string};
 use arbitrary::{Arbitrary, Result, Unstructured};
 use code_builder::CodeBuilderAllocations;
-use flagset::{flags, FlagSet};
+use flagset::{FlagSet, flags};
 use std::collections::{HashMap, HashSet};
 use std::fmt;
 use std::mem;
diff --git a/crates/wasm-smith/src/core/code_builder.rs b/crates/wasm-smith/src/core/code_builder.rs
index bc4c771d..0d0d04b2 100644
--- a/crates/wasm-smith/src/core/code_builder.rs
+++ b/crates/wasm-smith/src/core/code_builder.rs
@@ -2,7 +2,7 @@ use super::{
     CompositeInnerType, Elements, FuncType, Instruction, InstructionKind::*, InstructionKinds,
     Module, ValType,
 };
-use crate::{unique_string, MemoryOffsetChoices};
+use crate::{MemoryOffsetChoices, unique_string};
 use arbitrary::{Result, Unstructured};
 use std::collections::{BTreeMap, BTreeSet};
 use std::rc::Rc;
diff --git a/crates/wasm-smith/src/core/terminate.rs b/crates/wasm-smith/src/core/terminate.rs
index 33aff263..dcf266ca 100644
--- a/crates/wasm-smith/src/core/terminate.rs
+++ b/crates/wasm-smith/src/core/terminate.rs
@@ -1,5 +1,5 @@
 use super::*;
-use anyhow::{bail, Result};
+use anyhow::{Result, bail};
 
 impl Module {
     /// Ensure that all of this Wasm module's functions will terminate when
diff --git a/crates/wasm-wave/src/ast.rs b/crates/wasm-wave/src/ast.rs
index 72133943..91d989d7 100644
--- a/crates/wasm-wave/src/ast.rs
+++ b/crates/wasm-wave/src/ast.rs
@@ -5,7 +5,7 @@ use std::{borrow::Cow, collections::HashMap, str::FromStr};
 use crate::{
     lex::Span,
     parser::{ParserError, ParserErrorKind},
-    strings::{unescape, StringPartsIter},
+    strings::{StringPartsIter, unescape},
     wasm::{WasmType, WasmTypeKind, WasmValue, WasmValueError},
 };
 
@@ -230,7 +230,7 @@ impl Node {
             other => {
                 return Err(
                     self.wasm_value_error(WasmValueError::UnsupportedType(other.to_string()))
-                )
+                );
             }
         })
     }
diff --git a/crates/wasm-wave/src/parser.rs b/crates/wasm-wave/src/parser.rs
index b7576983..dd17954b 100644
--- a/crates/wasm-wave/src/parser.rs
+++ b/crates/wasm-wave/src/parser.rs
@@ -5,10 +5,10 @@ use std::{collections::HashSet, error::Error, fmt::Display};
 use indexmap::IndexMap;
 
 use crate::{
+    WasmValue,
     ast::{Node, NodeType},
     lex::{Keyword, Lexer, Span, Token},
     untyped::{UntypedFuncCall, UntypedValue},
-    WasmValue,
 };
 
 /// A Web Assembly Value Encoding parser.
diff --git a/crates/wasm-wave/src/untyped.rs b/crates/wasm-wave/src/untyped.rs
index 2706a7ac..8f57eb87 100644
--- a/crates/wasm-wave/src/untyped.rs
+++ b/crates/wasm-wave/src/untyped.rs
@@ -2,7 +2,7 @@
 
 use std::borrow::Cow;
 
-use crate::{ast::Node, lex::Keyword, parser::ParserError, Parser, WasmValue};
+use crate::{Parser, WasmValue, ast::Node, lex::Keyword, parser::ParserError};
 
 /// An UntypedValue is a parsed but not type-checked WAVE value.
 #[derive(Clone, Debug)]
diff --git a/crates/wasm-wave/src/value/convert.rs b/crates/wasm-wave/src/value/convert.rs
index a4ac337c..6338f165 100644
--- a/crates/wasm-wave/src/value/convert.rs
+++ b/crates/wasm-wave/src/value/convert.rs
@@ -1,7 +1,7 @@
 use crate::{
+    WasmValue,
     value::ValueEnum,
     wasm::{WasmType, WasmTypeKind},
-    WasmValue,
 };
 
 use super::{Type, Value};
@@ -204,8 +204,12 @@ impl_tuple!(
     (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12),
     (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13),
     (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14),
-    (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15),
-    (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)
+    (
+        T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15
+    ),
+    (
+        T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16
+    )
 );
 
 #[cfg(test)]
diff --git a/crates/wasm-wave/src/value/mod.rs b/crates/wasm-wave/src/value/mod.rs
index 3c3679c1..8c8e9fe4 100644
--- a/crates/wasm-wave/src/value/mod.rs
+++ b/crates/wasm-wave/src/value/mod.rs
@@ -17,8 +17,8 @@ use std::{borrow::Cow, collections::HashMap, sync::Arc};
 use crate::{
     canonicalize_nan32, canonicalize_nan64,
     wasm::{
-        ensure_type_kind, maybe_unwrap_type, unwrap_val, WasmType, WasmTypeKind, WasmValue,
-        WasmValueError,
+        WasmType, WasmTypeKind, WasmValue, WasmValueError, ensure_type_kind, maybe_unwrap_type,
+        unwrap_val,
     },
 };
 
diff --git a/crates/wasm-wave/src/value/ty.rs b/crates/wasm-wave/src/value/ty.rs
index 6a45bc39..94e269c2 100644
--- a/crates/wasm-wave/src/value/ty.rs
+++ b/crates/wasm-wave/src/value/ty.rs
@@ -1,6 +1,6 @@
 use std::{borrow::Cow, sync::Arc};
 
-use crate::wasm::{maybe_unwrap_type, WasmType, WasmTypeKind};
+use crate::wasm::{WasmType, WasmTypeKind, maybe_unwrap_type};
 
 /// The [`WasmType`] of a [`Value`](super::Value).
 #[derive(Clone, Debug, PartialEq, Eq)]
diff --git a/crates/wasm-wave/src/wasm/fmt.rs b/crates/wasm-wave/src/wasm/fmt.rs
index 3de9f468..3de9c96c 100644
--- a/crates/wasm-wave/src/wasm/fmt.rs
+++ b/crates/wasm-wave/src/wasm/fmt.rs
@@ -1,9 +1,9 @@
 use std::fmt::Display;
 
 use crate::{
+    WasmValue,
     wasm::{WasmFunc, WasmType, WasmTypeKind},
     writer::Writer,
-    WasmValue,
 };
 
 /// Implements a WAVE-formatted [`Display`] for a [`WasmType`].
diff --git a/crates/wasmparser/benches/benchmark.rs b/crates/wasmparser/benches/benchmark.rs
index d3e33f5e..3ed10a8f 100644
--- a/crates/wasmparser/benches/benchmark.rs
+++ b/crates/wasmparser/benches/benchmark.rs
@@ -1,5 +1,5 @@
 use anyhow::Result;
-use criterion::{criterion_group, criterion_main, Criterion};
+use criterion::{Criterion, criterion_group, criterion_main};
 use once_cell::unsync::Lazy;
 use std::fs;
 use std::path::Path;
diff --git a/crates/wasmparser/src/binary_reader.rs b/crates/wasmparser/src/binary_reader.rs
index decf534a..bcaaade5 100644
--- a/crates/wasmparser/src/binary_reader.rs
+++ b/crates/wasmparser/src/binary_reader.rs
@@ -786,7 +786,9 @@ impl<'a> BinaryReader<'a> {
         let magic_number = self.read_bytes(4)?;
         if magic_number != WASM_MAGIC_NUMBER {
             return Err(BinaryReaderError::new(
-                format!("magic header not detected: bad magic number - expected={WASM_MAGIC_NUMBER:#x?} actual={magic_number:#x?}"),
+                format!(
+                    "magic header not detected: bad magic number - expected={WASM_MAGIC_NUMBER:#x?} actual={magic_number:#x?}"
+                ),
                 self.original_position() - 4,
             ));
         }
diff --git a/crates/wasmparser/src/collections/index_map/detail.rs b/crates/wasmparser/src/collections/index_map/detail.rs
index 1558991c..f0c46f5c 100644
--- a/crates/wasmparser/src/collections/index_map/detail.rs
+++ b/crates/wasmparser/src/collections/index_map/detail.rs
@@ -39,7 +39,7 @@ mod impls {
 
 pub use self::impls::*;
 
-use alloc::collections::{btree_map, BTreeMap};
+use alloc::collections::{BTreeMap, btree_map};
 use alloc::vec::IntoIter as VecIntoIter;
 use alloc::vec::Vec;
 use core::borrow::Borrow;
diff --git a/crates/wasmparser/src/parser.rs b/crates/wasmparser/src/parser.rs
index 6112f2c1..feed15a8 100644
--- a/crates/wasmparser/src/parser.rs
+++ b/crates/wasmparser/src/parser.rs
@@ -1,19 +1,19 @@
-use crate::binary_reader::WASM_MAGIC_NUMBER;
-use crate::prelude::*;
 #[cfg(feature = "features")]
 use crate::WasmFeatures;
-#[cfg(feature = "component-model")]
-use crate::{
-    limits::MAX_WASM_MODULE_SIZE, ComponentCanonicalSectionReader, ComponentExportSectionReader,
-    ComponentImportSectionReader, ComponentInstanceSectionReader, ComponentStartFunction,
-    ComponentTypeSectionReader, CoreTypeSectionReader, InstanceSectionReader, SectionLimited,
-};
+use crate::binary_reader::WASM_MAGIC_NUMBER;
+use crate::prelude::*;
 use crate::{
     BinaryReader, BinaryReaderError, CustomSectionReader, DataSectionReader, ElementSectionReader,
     ExportSectionReader, FromReader, FunctionBody, FunctionSectionReader, GlobalSectionReader,
     ImportSectionReader, MemorySectionReader, Result, TableSectionReader, TagSectionReader,
     TypeSectionReader,
 };
+#[cfg(feature = "component-model")]
+use crate::{
+    ComponentCanonicalSectionReader, ComponentExportSectionReader, ComponentImportSectionReader,
+    ComponentInstanceSectionReader, ComponentStartFunction, ComponentTypeSectionReader,
+    CoreTypeSectionReader, InstanceSectionReader, SectionLimited, limits::MAX_WASM_MODULE_SIZE,
+};
 use core::fmt;
 use core::iter;
 use core::ops::Range;
diff --git a/crates/wasmparser/src/readers/component/aliases.rs b/crates/wasmparser/src/readers/component/aliases.rs
index bb0661a0..92654f3d 100644
--- a/crates/wasmparser/src/readers/component/aliases.rs
+++ b/crates/wasmparser/src/readers/component/aliases.rs
@@ -103,7 +103,7 @@ fn component_outer_alias_kind_from_bytes(
                     x,
                     "component outer alias kind",
                     offset + 1,
-                ))
+                ));
             }
         },
         0x03 => ComponentOuterAliasKind::Type,
@@ -113,7 +113,7 @@ fn component_outer_alias_kind_from_bytes(
                 x,
                 "component outer alias kind",
                 offset,
-            ))
+            ));
         }
     })
 }
diff --git a/crates/wasmparser/src/readers/component/exports.rs b/crates/wasmparser/src/readers/component/exports.rs
index 99e56a27..e00d0391 100644
--- a/crates/wasmparser/src/readers/component/exports.rs
+++ b/crates/wasmparser/src/readers/component/exports.rs
@@ -31,7 +31,7 @@ impl ComponentExternalKind {
                         x,
                         "component external kind",
                         offset + 1,
-                    ))
+                    ));
                 }
             },
             0x01 => ComponentExternalKind::Func,
@@ -44,7 +44,7 @@ impl ComponentExternalKind {
                     x,
                     "component external kind",
                     offset,
-                ))
+                ));
             }
         })
     }
@@ -93,7 +93,7 @@ impl<'a> FromReader<'a> for ComponentExport<'a> {
                         other,
                         "optional component export type",
                         reader.original_position() - 1,
-                    ))
+                    ));
                 }
             },
         })
diff --git a/crates/wasmparser/src/readers/core/coredumps.rs b/crates/wasmparser/src/readers/core/coredumps.rs
index 28fa4adc..64afb939 100644
--- a/crates/wasmparser/src/readers/core/coredumps.rs
+++ b/crates/wasmparser/src/readers/core/coredumps.rs
@@ -1,5 +1,5 @@
-use crate::{prelude::*, Ieee32, Ieee64};
 use crate::{BinaryReader, FromReader, Result};
+use crate::{Ieee32, Ieee64, prelude::*};
 
 /// The data portion of a custom section representing a core dump. Per the
 /// tool-conventions repo, this section just specifies the executable name that
diff --git a/crates/wasmparser/src/readers/core/types.rs b/crates/wasmparser/src/readers/core/types.rs
index 39a62ab2..5b35dccb 100644
--- a/crates/wasmparser/src/readers/core/types.rs
+++ b/crates/wasmparser/src/readers/core/types.rs
@@ -1859,7 +1859,7 @@ impl<'a> FromReader<'a> for AbstractHeapType {
                 return Err(BinaryReaderError::invalid(
                     "invalid abstract heap type",
                     reader.original_position() - 1,
-                ))
+                ));
             }
         }
     }
diff --git a/crates/wasmparser/src/readers/core/types/matches.rs b/crates/wasmparser/src/readers/core/types/matches.rs
index 030adc5d..85fff92a 100644
--- a/crates/wasmparser/src/readers/core/types/matches.rs
+++ b/crates/wasmparser/src/readers/core/types/matches.rs
@@ -13,9 +13,9 @@
 //! don't need to match again; we just look at the declarations from now on.
 
 use crate::{
-    types::{CoreTypeId, RecGroupId, TypeList},
     ArrayType, CompositeInnerType, CompositeType, ContType, FieldType, FuncType, RefType,
     StorageType, StructType, SubType, ValType,
+    types::{CoreTypeId, RecGroupId, TypeList},
 };
 
 /// Wasm type matching.
diff --git a/crates/wasmparser/src/resources.rs b/crates/wasmparser/src/resources.rs
index d5873fca..ff29fe66 100644
--- a/crates/wasmparser/src/resources.rs
+++ b/crates/wasmparser/src/resources.rs
@@ -14,8 +14,8 @@
  */
 
 use crate::{
-    types::CoreTypeId, BinaryReaderError, FuncType, GlobalType, HeapType, MemoryType, RefType,
-    SubType, TableType, ValType, WasmFeatures,
+    BinaryReaderError, FuncType, GlobalType, HeapType, MemoryType, RefType, SubType, TableType,
+    ValType, WasmFeatures, types::CoreTypeId,
 };
 
 /// Types that qualify as Wasm validation database.
diff --git a/crates/wasmparser/src/validator.rs b/crates/wasmparser/src/validator.rs
index 879644bd..a5c345e8 100644
--- a/crates/wasmparser/src/validator.rs
+++ b/crates/wasmparser/src/validator.rs
@@ -15,8 +15,9 @@
 
 use crate::prelude::*;
 use crate::{
-    limits::*, AbstractHeapType, BinaryReaderError, Encoding, FromReader, FunctionBody, HeapType,
-    Parser, Payload, RefType, Result, SectionLimited, ValType, WasmFeatures, WASM_MODULE_VERSION,
+    AbstractHeapType, BinaryReaderError, Encoding, FromReader, FunctionBody, HeapType, Parser,
+    Payload, RefType, Result, SectionLimited, ValType, WASM_MODULE_VERSION, WasmFeatures,
+    limits::*,
 };
 use ::core::mem;
 use ::core::ops::Range;
@@ -318,7 +319,9 @@ impl WasmFeatures {
                         if self.exceptions() {
                             Ok(())
                         } else {
-                            Err("exception refs not supported without the exception handling feature")
+                            Err(
+                                "exception refs not supported without the exception handling feature",
+                            )
                         }
                     }
 
@@ -327,7 +330,9 @@ impl WasmFeatures {
                         if self.stack_switching() {
                             Ok(())
                         } else {
-                            Err("continuation refs not supported without the stack switching feature")
+                            Err(
+                                "continuation refs not supported without the stack switching feature",
+                            )
                         }
                     }
                 }
@@ -665,7 +670,7 @@ impl Validator {
                 return Err(BinaryReaderError::new(
                     "wasm version header out of order",
                     range.start,
-                ))
+                ));
             }
         }
 
diff --git a/crates/wasmparser/src/validator/component_types.rs b/crates/wasmparser/src/validator/component_types.rs
index 6d9d36fc..4dfda525 100644
--- a/crates/wasmparser/src/validator/component_types.rs
+++ b/crates/wasmparser/src/validator/component_types.rs
@@ -2,13 +2,13 @@
 
 use super::component::ExternKind;
 use super::{CanonicalOptions, Concurrency};
+use crate::validator::StringEncoding;
 use crate::validator::names::KebabString;
 use crate::validator::types::{
     CoreTypeId, EntityType, SnapshotList, TypeAlloc, TypeData, TypeIdentifier, TypeInfo, TypeList,
     Types, TypesKind, TypesRef, TypesRefKind,
 };
-use crate::validator::StringEncoding;
-use crate::{prelude::*, AbstractHeapType, CompositeInnerType, HeapType, RefType, StorageType};
+use crate::{AbstractHeapType, CompositeInnerType, HeapType, RefType, StorageType, prelude::*};
 use crate::{
     BinaryReaderError, FuncType, MemoryType, PrimitiveValType, Result, TableType, ValType,
 };
diff --git a/crates/wasmparser/src/validator/core.rs b/crates/wasmparser/src/validator/core.rs
index ff5ae291..4c837340 100644
--- a/crates/wasmparser/src/validator/core.rs
+++ b/crates/wasmparser/src/validator/core.rs
@@ -7,18 +7,18 @@ pub(crate) use canonical::InternRecGroup;
 use self::arc::MaybeOwned;
 use super::{
     check_max, combine_type_sizes,
-    operators::{ty_to_str, OperatorValidator, OperatorValidatorAllocations},
+    operators::{OperatorValidator, OperatorValidatorAllocations, ty_to_str},
     types::{CoreTypeId, EntityType, RecGroupId, TypeAlloc, TypeList},
 };
 #[cfg(feature = "simd")]
 use crate::VisitSimdOperator;
 use crate::{
-    limits::*, BinaryReaderError, ConstExpr, Data, DataKind, Element, ElementKind, ExternalKind,
-    FuncType, Global, GlobalType, HeapType, MemoryType, RecGroup, RefType, Result, SubType, Table,
-    TableInit, TableType, TagType, TypeRef, UnpackedIndex, ValType, VisitOperator, WasmFeatures,
-    WasmModuleResources,
+    BinaryReaderError, ConstExpr, Data, DataKind, Element, ElementKind, ExternalKind, FuncType,
+    Global, GlobalType, HeapType, MemoryType, RecGroup, RefType, Result, SubType, Table, TableInit,
+    TableType, TagType, TypeRef, UnpackedIndex, ValType, VisitOperator, WasmFeatures,
+    WasmModuleResources, limits::*,
 };
-use crate::{prelude::*, CompositeInnerType};
+use crate::{CompositeInnerType, prelude::*};
 use alloc::sync::Arc;
 use core::mem;
 
@@ -742,7 +742,10 @@ impl Module {
 
         let page_size = if let Some(page_size_log2) = ty.page_size_log2 {
             if !self.features().custom_page_sizes() {
-                return Err(BinaryReaderError::new("the custom page sizes proposal must be enabled to customize a memory's page size", offset));
+                return Err(BinaryReaderError::new(
+                    "the custom page sizes proposal must be enabled to customize a memory's page size",
+                    offset,
+                ));
             }
             // Currently 2**0 and 2**16 are the only valid page sizes, but this
             // may be relaxed to allow any power of two in the future.
diff --git a/crates/wasmparser/src/validator/core/canonical.rs b/crates/wasmparser/src/validator/core/canonical.rs
index c8f6d060..89f78da7 100644
--- a/crates/wasmparser/src/validator/core/canonical.rs
+++ b/crates/wasmparser/src/validator/core/canonical.rs
@@ -69,9 +69,9 @@
 
 use super::{RecGroupId, TypeAlloc, TypeList};
 use crate::{
-    types::{CoreTypeId, TypeIdentifier},
     BinaryReaderError, CompositeInnerType, CompositeType, PackedIndex, RecGroup, Result,
     StorageType, UnpackedIndex, ValType, WasmFeatures,
+    types::{CoreTypeId, TypeIdentifier},
 };
 
 pub(crate) trait InternRecGroup {
diff --git a/crates/wasmparser/src/validator/func.rs b/crates/wasmparser/src/validator/func.rs
index f92365ac..bb5d7f13 100644
--- a/crates/wasmparser/src/validator/func.rs
+++ b/crates/wasmparser/src/validator/func.rs
@@ -63,6 +63,42 @@ pub struct FuncValidator<T> {
     index: u32,
 }
 
+impl<T: WasmModuleResources> ModuleArity for FuncValidator<T> {
+    fn sub_type_at(&self, type_idx: u32) -> Option<&crate::SubType> {
+        self.resources.sub_type_at(type_idx)
+    }
+
+    fn tag_type_arity(&self, at: u32) -> Option<(u32, u32)> {
+        let ty = self.resources.tag_at(at)?;
+        Some((
+            u32::try_from(ty.params().len()).unwrap(),
+            u32::try_from(ty.results().len()).unwrap(),
+        ))
+    }
+
+    fn type_index_of_function(&self, func_idx: u32) -> Option<u32> {
+        self.resources.type_index_of_function(func_idx)
+    }
+
+    fn func_type_of_cont_type(&self, cont_ty: &crate::ContType) -> Option<&crate::FuncType> {
+        let id = cont_ty.0.as_core_type_id()?;
+        Some(self.resources.sub_type_at_id(id).unwrap_func())
+    }
+
+    fn sub_type_of_ref_type(&self, rt: &crate::RefType) -> Option<&crate::SubType> {
+        let id = rt.type_index()?.as_core_type_id()?;
+        Some(self.resources.sub_type_at_id(id))
+    }
+
+    fn control_stack_height(&self) -> u32 {
+        u32::try_from(self.validator.control_stack_height()).unwrap()
+    }
+
+    fn label_block(&self, depth: u32) -> Option<(crate::BlockType, crate::FrameKind)> {
+        self.validator.jump(depth)
+    }
+}
+
 /// External handle to the internal allocations used during function validation.
 ///
 /// This is created with either the `Default` implementation or with
@@ -109,7 +145,9 @@ impl<T: WasmModuleResources> FuncValidator<T> {
                 let push_count = self.validator.pop_push_count.1 - pop_push_snapshot.1;
 
                 if pop_count != params || push_count != results {
-                    panic!("arity mismatch in validation. Expecting {params} operands popped, {results} pushed, but got {pop_count} popped, {push_count} pushed.");
+                    panic!(
+                        "arity mismatch in validation. Expecting {params} operands popped, {results} pushed, but got {pop_count} popped, {push_count} pushed."
+                    );
                 }
             }
         }
@@ -270,7 +308,7 @@ impl<T: WasmModuleResources> FuncValidator<T> {
 mod tests {
     use super::*;
     use crate::types::CoreTypeId;
-    use crate::{HeapType, RefType};
+    use crate::{HeapType, Parser, RefType, Validator};
 
     struct EmptyResources(crate::SubType);
 
@@ -356,18 +394,128 @@ mod tests {
         assert_eq!(v.operand_stack_height(), 1);
 
         // Entering a new control block does not affect the stack height.
-        assert!(v
-            .op(
+        assert!(
+            v.op(
                 1,
                 &Operator::Block {
                     blockty: crate::BlockType::Empty
                 }
             )
-            .is_ok());
+            .is_ok()
+        );
         assert_eq!(v.operand_stack_height(), 1);
 
         // Pushing another constant value makes use have two values on the stack.
         assert!(v.op(2, &Operator::I32Const { value: 99 }).is_ok());
         assert_eq!(v.operand_stack_height(), 2);
     }
+
+    #[test]
+    fn arity_smoke_test() {
+        let wasm = wat::parse_str(
+            r#"
+                (module
+                    (type $pair (struct (field i32) (field i32)))
+
+                    (func $add (param i32 i32) (result i32)
+                        local.get 0
+                        local.get 1
+                        i32.add
+                    )
+
+                    (func $f (param i32 i32) (result (ref null $pair))
+                        local.get 0
+                        local.get 1
+                        call $add
+                        if (result (ref null $pair))
+                        local.get 0
+                        local.get 1
+                          struct.new $pair
+                        else
+                          unreachable
+                          i32.add
+                          unreachable
+                        end
+                    )
+                )
+            "#,
+        )
+        .unwrap();
+
+        let expected_arity = vec![
+            // $add
+            vec![
+                // local.get 0
+                (0, 1),
+                // local.get 1
+                (0, 1),
+                // i32.add
+                (2, 1),
+                // end
+                (1, 1),
+            ],
+            // $f
+            vec![
+                // local.get 0
+                (0, 1),
+                // local.get 1
+                (0, 1),
+                // call $add
+                (2, 1),
+                // if
+                (1, 0),
+                // local.get 0
+                (0, 1),
+                // local.get 1
+                (0, 1),
+                // struct.new $pair
+                (2, 1),
+                // else
+                (1, 0),
+                // unreachable,
+                (0, 0),
+                // i32.add
+                (2, 1),
+                // unreachable
+                (0, 0),
+                // end
+                (1, 1),
+                // end
+                (1, 1),
+            ],
+        ];
+
+        let parser = Parser::new(0);
+        let mut validator = Validator::new();
+
+        let mut actual_arity = vec![];
+
+        for payload in parser.parse_all(&wasm) {
+            let payload = payload.unwrap();
+            match payload {
+                crate::Payload::CodeSectionEntry(body) => {
+                    let mut arity = vec![];
+                    let mut func_validator = validator
+                        .code_section_entry(&body)
+                        .unwrap()
+                        .into_validator(FuncValidatorAllocations::default());
+                    let ops = body.get_operators_reader().unwrap();
+                    for op in ops.into_iter() {
+                        let op = op.unwrap();
+                        arity.push(
+                            op.operator_arity(&func_validator)
+                                .expect("valid operators should have arity"),
+                        );
+                        func_validator.op(usize::MAX, &op).expect("should be valid");
+                    }
+                    actual_arity.push(arity);
+                }
+                p => {
+                    validator.payload(&p).unwrap();
+                }
+            }
+        }
+
+        assert_eq!(actual_arity, expected_arity);
+    }
 }
diff --git a/crates/wasmparser/src/validator/names.rs b/crates/wasmparser/src/validator/names.rs
index 41bdcb9b..f785e84b 100644
--- a/crates/wasmparser/src/validator/names.rs
+++ b/crates/wasmparser/src/validator/names.rs
@@ -28,11 +28,7 @@ impl KebabStr {
     /// Returns `None` if the given string is not a valid kebab string.
     pub fn new<'a>(s: impl AsRef<str> + 'a) -> Option<&'a Self> {
         let s = Self::new_unchecked(s);
-        if s.is_kebab_case() {
-            Some(s)
-        } else {
-            None
-        }
+        if s.is_kebab_case() { Some(s) } else { None }
     }
 
     pub(crate) fn new_unchecked<'a>(s: impl AsRef<str> + 'a) -> &'a Self {
diff --git a/crates/wasmparser/src/validator/operators.rs b/crates/wasmparser/src/validator/operators.rs
index 1a599681..f76f61ee 100644
--- a/crates/wasmparser/src/validator/operators.rs
+++ b/crates/wasmparser/src/validator/operators.rs
@@ -25,12 +25,12 @@
 #[cfg(feature = "simd")]
 use crate::VisitSimdOperator;
 use crate::{
-    limits::MAX_WASM_FUNCTION_LOCALS, AbstractHeapType, BinaryReaderError, BlockType, BrTable,
-    Catch, ContType, FieldType, FrameKind, FuncType, GlobalType, Handle, HeapType, Ieee32, Ieee64,
-    MemArg, ModuleArity, RefType, Result, ResumeTable, StorageType, StructType, SubType, TableType,
-    TryTable, UnpackedIndex, ValType, VisitOperator, WasmFeatures, WasmModuleResources,
+    AbstractHeapType, BinaryReaderError, BlockType, BrTable, Catch, ContType, FieldType, FrameKind,
+    FuncType, GlobalType, Handle, HeapType, Ieee32, Ieee64, MemArg, ModuleArity, RefType, Result,
+    ResumeTable, StorageType, StructType, SubType, TableType, TryTable, UnpackedIndex, ValType,
+    VisitOperator, WasmFeatures, WasmModuleResources, limits::MAX_WASM_FUNCTION_LOCALS,
 };
-use crate::{prelude::*, CompositeInnerType, Ordering};
+use crate::{CompositeInnerType, Ordering, prelude::*};
 use core::ops::{Deref, DerefMut};
 use core::{cmp, iter};
 
@@ -468,6 +468,17 @@ impl OperatorValidator {
         self.control.len()
     }
 
+    /// Validates a relative jump to the `depth` specified.
+    ///
+    /// Returns the type signature of the block that we're jumping to as well
+    /// as the kind of block if the jump is valid. Otherwise returns an error.
+    pub(crate) fn jump(&self, depth: u32) -> Option<(BlockType, FrameKind)> {
+        assert!(!self.control.is_empty());
+        let i = (self.control.len() - 1).checked_sub(depth as usize)?;
+        let frame = &self.control[i];
+        Some((frame.block_type, frame.kind))
+    }
+
     pub fn get_frame(&self, depth: usize) -> Option<&Frame> {
         self.control.iter().rev().nth(depth)
     }
@@ -957,12 +968,8 @@ where
     /// Returns the type signature of the block that we're jumping to as well
     /// as the kind of block if the jump is valid. Otherwise returns an error.
     fn jump(&self, depth: u32) -> Result<(BlockType, FrameKind)> {
-        assert!(!self.control.is_empty());
-        match (self.control.len() - 1).checked_sub(depth as usize) {
-            Some(i) => {
-                let frame = &self.control[i];
-                Ok((frame.block_type, frame.kind))
-            }
+        match self.inner.jump(depth) {
+            Some(tup) => Ok(tup),
             None => bail!(self.offset, "unknown label: branch depth too large"),
         }
     }
@@ -1584,43 +1591,58 @@ where
                     // Pop the continuation reference.
                     match self.label_types(block.0, block.1)?.last() {
                         Some(ValType::Ref(rt)) if rt.is_concrete_type_ref() => {
-                            let sub_ty = self.resources.sub_type_at_id(rt.type_index().unwrap().as_core_type_id().expect("canonicalized index"));
-                            let new_cont =
-                                if let CompositeInnerType::Cont(cont) = &sub_ty.composite_type.inner {
-                                    cont
-                                } else {
-                                    bail!(self.offset, "non-continuation type");
-                                };
+                            let sub_ty = self.resources.sub_type_at_id(
+                                rt.type_index()
+                                    .unwrap()
+                                    .as_core_type_id()
+                                    .expect("canonicalized index"),
+                            );
+                            let new_cont = if let CompositeInnerType::Cont(cont) =
+                                &sub_ty.composite_type.inner
+                            {
+                                cont
+                            } else {
+                                bail!(self.offset, "non-continuation type");
+                            };
                             let new_func_ty = self.func_type_of_cont_type(&new_cont);
                             // Check that (ts2' -> ts2) <: $ft
-                            if new_func_ty.params().len() != tag_ty.results().len() || !self.is_subtype_many(new_func_ty.params(), tag_ty.results())
-                                || old_func_ty.results().len() != new_func_ty.results().len() || !self.is_subtype_many(old_func_ty.results(), new_func_ty.results()) {
+                            if new_func_ty.params().len() != tag_ty.results().len()
+                                || !self.is_subtype_many(new_func_ty.params(), tag_ty.results())
+                                || old_func_ty.results().len() != new_func_ty.results().len()
+                                || !self
+                                    .is_subtype_many(old_func_ty.results(), new_func_ty.results())
+                            {
                                 bail!(self.offset, "type mismatch in continuation type")
                             }
                             let expected_nargs = tag_ty.params().len() + 1;
-                            let actual_nargs = self
-                                .label_types(block.0, block.1)?
-                                .len();
+                            let actual_nargs = self.label_types(block.0, block.1)?.len();
                             if actual_nargs != expected_nargs {
-                                bail!(self.offset, "type mismatch: expected {expected_nargs} label result(s), but label is annotated with {actual_nargs} results")
+                                bail!(
+                                    self.offset,
+                                    "type mismatch: expected {expected_nargs} label result(s), but label is annotated with {actual_nargs} results"
+                                )
                             }
 
-                            let labeltys = self
-                                .label_types(block.0, block.1)?
-                                .take(expected_nargs - 1);
+                            let labeltys =
+                                self.label_types(block.0, block.1)?.take(expected_nargs - 1);
 
                             // Check that ts1'' <: ts1'.
                             for (tagty, &lblty) in labeltys.zip(tag_ty.params()) {
                                 if !self.resources.is_subtype(lblty, tagty) {
-                                    bail!(self.offset, "type mismatch between tag type and label type")
+                                    bail!(
+                                        self.offset,
+                                        "type mismatch between tag type and label type"
+                                    )
                                 }
                             }
                         }
                         Some(ty) => {
                             bail!(self.offset, "type mismatch: {}", ty_to_str(ty))
                         }
-                        _ => bail!(self.offset,
-                                   "type mismatch: instruction requires continuation reference type but label has none")
+                        _ => bail!(
+                            self.offset,
+                            "type mismatch: instruction requires continuation reference type but label has none"
+                        ),
                     }
                 }
                 Handle::OnSwitch { tag } => {
@@ -2095,7 +2117,10 @@ where
         let ty = self.global_type_at(global_index)?.content_type;
         let supertype = RefType::ANYREF.into();
         if !(ty == ValType::I32 || ty == ValType::I64 || self.resources.is_subtype(ty, supertype)) {
-            bail!(self.offset, "invalid type: `global.atomic.get` only allows `i32`, `i64` and subtypes of `anyref`");
+            bail!(
+                self.offset,
+                "invalid type: `global.atomic.get` only allows `i32`, `i64` and subtypes of `anyref`"
+            );
         }
         Ok(())
     }
@@ -2117,7 +2142,10 @@ where
         let ty = self.global_type_at(global_index)?.content_type;
         let supertype = RefType::ANYREF.into();
         if !(ty == ValType::I32 || ty == ValType::I64 || self.resources.is_subtype(ty, supertype)) {
-            bail!(self.offset, "invalid type: `global.atomic.set` only allows `i32`, `i64` and subtypes of `anyref`");
+            bail!(
+                self.offset,
+                "invalid type: `global.atomic.set` only allows `i32`, `i64` and subtypes of `anyref`"
+            );
         }
         Ok(())
     }
@@ -2171,7 +2199,10 @@ where
             || ty == ValType::I64
             || self.resources.is_subtype(ty, RefType::ANYREF.into()))
         {
-            bail!(self.offset, "invalid type: `global.atomic.rmw.xchg` only allows `i32`, `i64` and subtypes of `anyref`");
+            bail!(
+                self.offset,
+                "invalid type: `global.atomic.rmw.xchg` only allows `i32`, `i64` and subtypes of `anyref`"
+            );
         }
         self.check_unary_op(ty)
     }
@@ -2185,7 +2216,10 @@ where
             || ty == ValType::I64
             || self.resources.is_subtype(ty, RefType::EQREF.into()))
         {
-            bail!(self.offset, "invalid type: `global.atomic.rmw.cmpxchg` only allows `i32`, `i64` and subtypes of `eqref`");
+            bail!(
+                self.offset,
+                "invalid type: `global.atomic.rmw.cmpxchg` only allows `i32`, `i64` and subtypes of `eqref`"
+            );
         }
         self.check_binary_op(ty)
     }
diff --git a/crates/wasmparser/src/validator/operators/simd.rs b/crates/wasmparser/src/validator/operators/simd.rs
index b52015a2..c86773bb 100644
--- a/crates/wasmparser/src/validator/operators/simd.rs
+++ b/crates/wasmparser/src/validator/operators/simd.rs
@@ -1,6 +1,6 @@
 use super::OperatorValidatorTemp;
 use crate::{MemArg, Result, ValType, WasmModuleResources};
-use crate::{VisitSimdOperator, V128};
+use crate::{V128, VisitSimdOperator};
 
 impl<'resources, R> OperatorValidatorTemp<'_, 'resources, R>
 where
diff --git a/crates/wasmparser/src/validator/types.rs b/crates/wasmparser/src/validator/types.rs
index 6eb71f46..c1d69f4a 100644
--- a/crates/wasmparser/src/validator/types.rs
+++ b/crates/wasmparser/src/validator/types.rs
@@ -5,8 +5,8 @@ use super::core::Module;
 use crate::validator::component::ComponentState;
 #[cfg(feature = "component-model")]
 use crate::validator::component_types::{ComponentTypeAlloc, ComponentTypeList};
-use crate::{collections::map::Entry, AbstractHeapType};
-use crate::{prelude::*, CompositeInnerType};
+use crate::{AbstractHeapType, collections::map::Entry};
+use crate::{CompositeInnerType, prelude::*};
 use crate::{
     Export, ExternalKind, GlobalType, Import, Matches, MemoryType, PackedIndex, RecGroup, RefType,
     Result, SubType, TableType, TypeRef, UnpackedIndex, ValType, WithRecGroup,
diff --git a/crates/wasmprinter/src/component.rs b/crates/wasmprinter/src/component.rs
index 8880cec6..339389a5 100644
--- a/crates/wasmprinter/src/component.rs
+++ b/crates/wasmprinter/src/component.rs
@@ -1,5 +1,5 @@
-use crate::{name_map, Naming, Printer, State};
-use anyhow::{bail, Result};
+use crate::{Naming, Printer, State, name_map};
+use anyhow::{Result, bail};
 use wasmparser::*;
 
 impl Printer<'_, '_> {
diff --git a/crates/wasmprinter/src/lib.rs b/crates/wasmprinter/src/lib.rs
index c33c0b74..dd0d21f8 100644
--- a/crates/wasmprinter/src/lib.rs
+++ b/crates/wasmprinter/src/lib.rs
@@ -8,7 +8,7 @@
 
 #![deny(missing_docs)]
 
-use anyhow::{anyhow, bail, Context, Result};
+use anyhow::{Context, Result, anyhow, bail};
 use operator::{OpPrinter, OperatorSeparator, OperatorState, PrintOperator, PrintOperatorFolded};
 use std::collections::{HashMap, HashSet};
 use std::fmt;
diff --git a/crates/wasmprinter/src/operator.rs b/crates/wasmprinter/src/operator.rs
index 65324de9..f758772d 100644
--- a/crates/wasmprinter/src/operator.rs
+++ b/crates/wasmprinter/src/operator.rs
@@ -1,5 +1,5 @@
 use super::{Config, Print, PrintTermcolor, Printer, State};
-use anyhow::{anyhow, bail, Result};
+use anyhow::{Result, anyhow, bail};
 use termcolor::{Ansi, NoColor};
 use wasmparser::VisitSimdOperator;
 use wasmparser::{
diff --git a/crates/wast/src/component/alias.rs b/crates/wast/src/component/alias.rs
index dffcda14..7c777611 100644
--- a/crates/wast/src/component/alias.rs
+++ b/crates/wast/src/component/alias.rs
@@ -53,7 +53,7 @@ impl<'a> Alias<'a> {
             let mut kind: ComponentOuterAliasKind = parser.parse()?;
             match kind {
                 ComponentOuterAliasKind::CoreType => {
-                    return Err(parser.error("expected type for outer alias"))
+                    return Err(parser.error("expected type for outer alias"));
                 }
                 ComponentOuterAliasKind::Type => {
                     kind = ComponentOuterAliasKind::CoreType;
diff --git a/crates/wast/src/component/resolve.rs b/crates/wast/src/component/resolve.rs
index 49144ac2..54e6f3e2 100644
--- a/crates/wast/src/component/resolve.rs
+++ b/crates/wast/src/component/resolve.rs
@@ -1,10 +1,10 @@
+use crate::Error;
 use crate::component::*;
-use crate::core::{self, resolve::ResolveCoreType, ValType};
+use crate::core::{self, ValType, resolve::ResolveCoreType};
 use crate::kw;
 use crate::names::Namespace;
 use crate::token::Span;
 use crate::token::{Id, Index};
-use crate::Error;
 
 /// Resolve the fields of a component and everything nested within it, changing
 /// `Index::Id` to `Index::Num` and expanding alias syntax sugar.
diff --git a/crates/wast/src/core/binary.rs b/crates/wast/src/core/binary.rs
index 2482cdcb..98dd2c3e 100644
--- a/crates/wast/src/core/binary.rs
+++ b/crates/wast/src/core/binary.rs
@@ -1,9 +1,9 @@
+use crate::Wat;
 #[cfg(feature = "component-model")]
 use crate::component::Component;
 use crate::core::*;
 use crate::encode::Encode;
 use crate::token::*;
-use crate::Wat;
 use std::borrow::Cow;
 use std::marker;
 #[cfg(feature = "dwarf")]
diff --git a/crates/wast/src/core/binary/dwarf_disabled.rs b/crates/wast/src/core/binary/dwarf_disabled.rs
index 214b9fb5..9d807518 100644
--- a/crates/wast/src/core/binary/dwarf_disabled.rs
+++ b/crates/wast/src/core/binary/dwarf_disabled.rs
@@ -1,8 +1,8 @@
 //! Dummy version of dwarf emission that does nothing when the compile-time
 //! feature is disabled.
 
-use crate::core::binary::{EncodeOptions, Encoder, Names, RecOrType};
 use crate::core::Local;
+use crate::core::binary::{EncodeOptions, Encoder, Names, RecOrType};
 use crate::token::Span;
 
 pub struct Dwarf<'a> {
diff --git a/crates/wast/src/core/expr.rs b/crates/wast/src/core/expr.rs
index 46bb607f..20927b4c 100644
--- a/crates/wast/src/core/expr.rs
+++ b/crates/wast/src/core/expr.rs
@@ -296,7 +296,7 @@ impl<'a> ExpressionParser<'a> {
                     }
                 }
                 Paren::None => {
-                    return Err(parser.error("expected to continue a folded instruction"))
+                    return Err(parser.error("expected to continue a folded instruction"));
                 }
             }
         }
@@ -1537,7 +1537,7 @@ impl<'a> MemArg<'a> {
         let offset = parse_field("offset", parser)?.unwrap_or(0);
         let align = match parse_field("align", parser)? {
             Some(n) if !n.is_power_of_two() => {
-                return Err(parser.error("alignment must be a power of two"))
+                return Err(parser.error("alignment must be a power of two"));
             }
             n => n.unwrap_or(default_align),
         };
diff --git a/crates/wast/src/core/resolve/mod.rs b/crates/wast/src/core/resolve/mod.rs
index 9e695c07..38981335 100644
--- a/crates/wast/src/core/resolve/mod.rs
+++ b/crates/wast/src/core/resolve/mod.rs
@@ -1,6 +1,6 @@
 use crate::core::*;
 use crate::token::Index;
-use crate::{gensym, Error};
+use crate::{Error, gensym};
 
 mod deinline_import_export;
 mod names;
diff --git a/crates/wast/src/core/resolve/names.rs b/crates/wast/src/core/resolve/names.rs
index 8075b53f..533e43f0 100644
--- a/crates/wast/src/core/resolve/names.rs
+++ b/crates/wast/src/core/resolve/names.rs
@@ -1,8 +1,8 @@
+use crate::Error;
 use crate::core::resolve::Ns;
 use crate::core::*;
-use crate::names::{resolve_error, Namespace};
+use crate::names::{Namespace, resolve_error};
 use crate::token::{Id, Index};
-use crate::Error;
 use std::collections::HashMap;
 
 pub fn resolve<'a>(fields: &mut Vec<ModuleField<'a>>) -> Result<Resolver<'a>, Error> {
@@ -112,7 +112,7 @@ impl<'a> Resolver<'a> {
 
             // These fields don't define any items in any index space.
             ModuleField::Export(_) | ModuleField::Start(_) | ModuleField::Custom(_) => {
-                return Ok(())
+                return Ok(());
             }
         };
 
@@ -752,13 +752,13 @@ impl<'a> TypeReference<'a> for FunctionType<'a> {
                 return Err(Error::new(
                     idx.span(),
                     format!("invalid type: not a function type"),
-                ))
+                ));
             }
             _ => {
                 return Err(Error::new(
                     idx.span(),
                     format!("unknown type: type index out of bounds"),
-                ))
+                ));
             }
         };
 
diff --git a/crates/wast/src/core/types.rs b/crates/wast/src/core/types.rs
index b1a4ed20..d3521c8c 100644
--- a/crates/wast/src/core/types.rs
+++ b/crates/wast/src/core/types.rs
@@ -1,9 +1,9 @@
+use crate::Error;
 use crate::core::*;
 use crate::kw;
 use crate::parser::Lookahead1;
 use crate::parser::{Cursor, Parse, Parser, Peek, Result};
 use crate::token::{Id, Index, LParen, NameAnnotation, Span};
-use crate::Error;
 use std::mem;
 
 /// The value types for a wasm module.
diff --git a/crates/wast/src/core/wast.rs b/crates/wast/src/core/wast.rs
index d71350f7..849c7751 100644
--- a/crates/wast/src/core/wast.rs
+++ b/crates/wast/src/core/wast.rs
@@ -1,7 +1,7 @@
 use crate::core::{HeapType, V128Const};
 use crate::kw;
 use crate::parser::{Cursor, Parse, Parser, Peek, Result};
-use crate::token::{Index, F32, F64};
+use crate::token::{F32, F64, Index};
 
 /// Expression that can be used inside of `invoke` expressions for core wasm
 /// functions.
diff --git a/crates/wast/src/lexer.rs b/crates/wast/src/lexer.rs
index 92bd82a3..d7f9f0e7 100644
--- a/crates/wast/src/lexer.rs
+++ b/crates/wast/src/lexer.rs
@@ -24,8 +24,8 @@
 //!
 //! [`Lexer`]: crate::lexer::Lexer
 
-use crate::token::Span;
 use crate::Error;
+use crate::token::Span;
 use std::borrow::Cow;
 use std::char;
 use std::fmt;
@@ -669,7 +669,7 @@ impl<'a> Lexer<'a> {
                     has_underscores,
                     sign,
                     hex,
-                }))
+                }));
             }
         }
 
@@ -827,10 +827,10 @@ impl<'a> Lexer<'a> {
                     }
                 }
                 c if (c as u32) < 0x20 || c as u32 == 0x7f => {
-                    return Err(LexError::InvalidStringElement(c))
+                    return Err(LexError::InvalidStringElement(c));
                 }
                 c if !allow_confusing_unicode && is_confusing_unicode(c) => {
-                    return Err(LexError::ConfusingUnicode(c))
+                    return Err(LexError::ConfusingUnicode(c));
                 }
                 c => match &mut state {
                     State::Start => {}
diff --git a/crates/wast/src/names.rs b/crates/wast/src/names.rs
index ec3e803f..b7ef507e 100644
--- a/crates/wast/src/names.rs
+++ b/crates/wast/src/names.rs
@@ -1,5 +1,5 @@
-use crate::token::{Id, Index};
 use crate::Error;
+use crate::token::{Id, Index};
 use std::collections::HashMap;
 
 #[derive(Default)]
diff --git a/crates/wast/src/parser.rs b/crates/wast/src/parser.rs
index d7930fdf..54305b2b 100644
--- a/crates/wast/src/parser.rs
+++ b/crates/wast/src/parser.rs
@@ -62,9 +62,9 @@
 //! This module is heavily inspired by [`syn`](https://docs.rs/syn) so you can
 //! likely also draw inspiration from the excellent examples in the `syn` crate.
 
+use crate::Error;
 use crate::lexer::{Float, Integer, Lexer, Token, TokenKind};
 use crate::token::Span;
-use crate::Error;
 use bumpalo::Bump;
 use std::borrow::Cow;
 use std::cell::{Cell, RefCell};
@@ -429,7 +429,7 @@ impl ParseBuffer<'_> {
             match token.kind {
                 // Always skip whitespace and comments.
                 TokenKind::Whitespace | TokenKind::LineComment | TokenKind::BlockComment => {
-                    continue
+                    continue;
                 }
 
                 // If an lparen is seen then this may be skipped if it's an
diff --git a/crates/wat/src/lib.rs b/crates/wat/src/lib.rs
index 120bb4ab..dff9232c 100644
--- a/crates/wat/src/lib.rs
+++ b/crates/wat/src/lib.rs
@@ -466,9 +466,10 @@ mod test {
         );
 
         let e = parse_file("_does_not_exist_").unwrap_err();
-        assert!(e
-            .to_string()
-            .starts_with("failed to read from `_does_not_exist_`"));
+        assert!(
+            e.to_string()
+                .starts_with("failed to read from `_does_not_exist_`")
+        );
 
         let mut e = parse_bytes("()".as_bytes()).unwrap_err();
         e.set_path("foo");
diff --git a/crates/wit-component/dl/src/lib.rs b/crates/wit-component/dl/src/lib.rs
index 9d7cc707..8cb486eb 100644
--- a/crates/wit-component/dl/src/lib.rs
+++ b/crates/wit-component/dl/src/lib.rs
@@ -6,7 +6,7 @@
 //! component link` arranges as part of component instantiation.
 
 use core::{
-    ffi::{c_char, c_int, c_void, CStr},
+    ffi::{CStr, c_char, c_int, c_void},
     ptr, slice,
 };
 
@@ -75,11 +75,7 @@ unsafe fn invalid_handle(library: *const c_void) -> bool {
 /// `dlopen`.
 #[no_mangle]
 pub unsafe extern "C" fn dlclose(library: *mut c_void) -> c_int {
-    if invalid_handle(library) {
-        -1
-    } else {
-        0
-    }
+    if invalid_handle(library) { -1 } else { 0 }
 }
 
 #[no_mangle]
diff --git a/crates/wit-component/src/encoding.rs b/crates/wit-component/src/encoding.rs
index d9eefc37..92f04bda 100644
--- a/crates/wit-component/src/encoding.rs
+++ b/crates/wit-component/src/encoding.rs
@@ -71,10 +71,10 @@
 //! otherwise there's no way to run a `wasi_snapshot_preview1` module within the
 //! component model.
 
+use crate::StringEncoding;
 use crate::metadata::{self, Bindgen, ModuleMetadata};
 use crate::validation::{Export, ExportMap, Import, ImportInstance, ImportMap, PayloadInfo};
-use crate::StringEncoding;
-use anyhow::{anyhow, bail, Context, Result};
+use anyhow::{Context, Result, anyhow, bail};
 use indexmap::{IndexMap, IndexSet};
 use std::borrow::Cow;
 use std::collections::HashMap;
@@ -83,9 +83,9 @@ use std::mem;
 use wasm_encoder::*;
 use wasmparser::{Validator, WasmFeatures};
 use wit_parser::{
-    abi::{AbiVariant, WasmSignature, WasmType},
     Function, FunctionKind, InterfaceId, LiveTypes, Resolve, Stability, Type, TypeDefKind, TypeId,
     TypeOwner, WorldItem, WorldKey,
+    abi::{AbiVariant, WasmSignature, WasmType},
 };
 
 const INDIRECT_TABLE_NAME: &str = "$imports";
diff --git a/crates/wit-component/src/encoding/world.rs b/crates/wit-component/src/encoding/world.rs
index 91e64fe6..fbfe7df8 100644
--- a/crates/wit-component/src/encoding/world.rs
+++ b/crates/wit-component/src/encoding/world.rs
@@ -1,15 +1,15 @@
 use super::{Adapter, ComponentEncoder, LibraryInfo, RequiredOptions};
 use crate::validation::{
-    validate_adapter_module, validate_module, Import, ImportMap, ValidatedModule,
+    Import, ImportMap, ValidatedModule, validate_adapter_module, validate_module,
 };
 use anyhow::{Context, Result};
 use indexmap::{IndexMap, IndexSet};
 use std::borrow::Cow;
 use std::collections::{HashMap, HashSet};
 use wit_parser::{
-    abi::{AbiVariant, WasmSignature},
     Function, InterfaceId, LiveTypes, Resolve, TypeDefKind, TypeId, TypeOwner, WorldId, WorldItem,
     WorldKey,
+    abi::{AbiVariant, WasmSignature},
 };
 
 pub struct WorldAdapter<'a> {
diff --git a/crates/wit-component/src/gc.rs b/crates/wit-component/src/gc.rs
index f9a66e8b..71a58e4d 100644
--- a/crates/wit-component/src/gc.rs
+++ b/crates/wit-component/src/gc.rs
@@ -1,5 +1,5 @@
 use self::bitvec::BitVec;
-use anyhow::{bail, Result};
+use anyhow::{Result, bail};
 use indexmap::{IndexMap, IndexSet};
 use std::{
     borrow::Cow,
@@ -8,7 +8,7 @@ use std::{
     mem,
     ops::Deref,
 };
-use wasm_encoder::{reencode::Reencode, Encode, EntityType, RawCustomSection};
+use wasm_encoder::{Encode, EntityType, RawCustomSection, reencode::Reencode};
 use wasmparser::*;
 
 const PAGE_SIZE: i32 = 64 * 1024;
@@ -1013,11 +1013,7 @@ fn live_iter<'a, T>(
 ) -> impl Iterator<Item = (u32, T)> + 'a {
     iter.enumerate().filter_map(|(i, t)| {
         let i = i as u32;
-        if live.contains(i) {
-            Some((i, t))
-        } else {
-            None
-        }
+        if live.contains(i) { Some((i, t)) } else { None }
     })
 }
 
diff --git a/crates/wit-component/src/lib.rs b/crates/wit-component/src/lib.rs
index 07f3409f..f59e6d55 100644
--- a/crates/wit-component/src/lib.rs
+++ b/crates/wit-component/src/lib.rs
@@ -6,7 +6,7 @@
 use std::str::FromStr;
 use std::{borrow::Cow, fmt::Display};
 
-use anyhow::{bail, Result};
+use anyhow::{Result, bail};
 use wasm_encoder::{CanonicalOption, Encode, Section};
 use wit_parser::{Resolve, WorldId};
 
@@ -17,11 +17,11 @@ mod printing;
 mod targets;
 mod validation;
 
-pub use encoding::{encode, ComponentEncoder, LibraryInfo};
+pub use encoding::{ComponentEncoder, LibraryInfo, encode};
 pub use linking::Linker;
 pub use printing::*;
 pub use targets::*;
-pub use wit_parser::decoding::{decode, decode_reader, DecodedWasm};
+pub use wit_parser::decoding::{DecodedWasm, decode, decode_reader};
 
 pub mod metadata;
 
@@ -113,7 +113,7 @@ mod tests {
     use wasmparser::Payload;
     use wit_parser::Resolve;
 
-    use super::{embed_component_metadata, StringEncoding};
+    use super::{StringEncoding, embed_component_metadata};
 
     const MODULE_WAT: &str = r#"
 (module
diff --git a/crates/wit-component/src/linking.rs b/crates/wit-component/src/linking.rs
index f5b15d82..4063bd20 100644
--- a/crates/wit-component/src/linking.rs
+++ b/crates/wit-component/src/linking.rs
@@ -24,8 +24,8 @@
 
 use {
     crate::encoding::{ComponentEncoder, Instance, Item, LibraryInfo, MainOrAdapter},
-    anyhow::{anyhow, bail, Context, Result},
-    indexmap::{map::Entry, IndexMap, IndexSet},
+    anyhow::{Context, Result, anyhow, bail},
+    indexmap::{IndexMap, IndexSet, map::Entry},
     metadata::{Export, ExportKey, FunctionType, GlobalType, Metadata, Type, ValueType},
     std::{
         collections::{BTreeMap, HashMap, HashSet},
@@ -257,7 +257,9 @@ impl<K: Hash + Eq + PartialEq + Debug, V: Debug> InsertUnique for HashMap<K, V>
 
     fn insert_unique(&mut self, k: Self::Key, v: Self::Value) {
         if let Some(old_v) = self.get(&k) {
-            panic!("duplicate item inserted into map for key {k:?} (old value: {old_v:?}; new value: {v:?})");
+            panic!(
+                "duplicate item inserted into map for key {k:?} (old value: {old_v:?}; new value: {v:?})"
+            );
         }
         self.insert(k, v);
     }
diff --git a/crates/wit-component/src/linking/metadata.rs b/crates/wit-component/src/linking/metadata.rs
index 6c91a517..eab6e33f 100644
--- a/crates/wit-component/src/linking/metadata.rs
+++ b/crates/wit-component/src/linking/metadata.rs
@@ -2,7 +2,7 @@
 //! library](https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md) modules.
 
 use {
-    anyhow::{bail, Context, Error, Result},
+    anyhow::{Context, Error, Result, bail},
     std::{
         collections::{BTreeSet, HashMap, HashSet},
         fmt,
diff --git a/crates/wit-component/src/metadata.rs b/crates/wit-component/src/metadata.rs
index 55bc41ec..1a0fb964 100644
--- a/crates/wit-component/src/metadata.rs
+++ b/crates/wit-component/src/metadata.rs
@@ -42,7 +42,7 @@
 //! the three arguments originally passed to `encode`.
 
 use crate::{DecodedWasm, StringEncoding};
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use indexmap::{IndexMap, IndexSet};
 use std::borrow::Cow;
 use wasm_encoder::{
diff --git a/crates/wit-component/src/printing.rs b/crates/wit-component/src/printing.rs
index 868b4553..c3473fcf 100644
--- a/crates/wit-component/src/printing.rs
+++ b/crates/wit-component/src/printing.rs
@@ -1,4 +1,4 @@
-use anyhow::{anyhow, bail, Result};
+use anyhow::{Result, anyhow, bail};
 use std::borrow::Cow;
 use std::collections::HashMap;
 use std::fmt::Display;
diff --git a/crates/wit-component/src/semver_check.rs b/crates/wit-component/src/semver_check.rs
index 5be11054..edaee826 100644
--- a/crates/wit-component/src/semver_check.rs
+++ b/crates/wit-component/src/semver_check.rs
@@ -1,8 +1,8 @@
 use crate::{
-    dummy_module, embed_component_metadata, encoding::encode_world, ComponentEncoder,
-    StringEncoding,
+    ComponentEncoder, StringEncoding, dummy_module, embed_component_metadata,
+    encoding::encode_world,
 };
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use wasm_encoder::{ComponentBuilder, ComponentExportKind, ComponentTypeRef};
 use wasmparser::Validator;
 use wit_parser::{ManglingAndAbi, Resolve, WorldId};
@@ -56,7 +56,9 @@ pub fn semver_check(mut resolve: Resolve, prev: WorldId, new: WorldId) -> Result
         .context("new world not in named package")?;
     let new_pkg_name = &resolve.packages[new_pkg_id].name;
     if old_pkg_name != new_pkg_name {
-        bail!("the old world is in package {old_pkg_name}, which is not the same as the new world, which is in package {new_pkg_name}", )
+        bail!(
+            "the old world is in package {old_pkg_name}, which is not the same as the new world, which is in package {new_pkg_name}",
+        )
     }
 
     // Component that will be validated at the end.
diff --git a/crates/wit-component/src/validation.rs b/crates/wit-component/src/validation.rs
index a1f18e88..435c5dbd 100644
--- a/crates/wit-component/src/validation.rs
+++ b/crates/wit-component/src/validation.rs
@@ -1,19 +1,19 @@
 use crate::encoding::{Instance, Item, LibraryInfo, MainOrAdapter, ModuleImportMap};
 use crate::{ComponentEncoder, StringEncoding};
-use anyhow::{anyhow, bail, Context, Result};
-use indexmap::{map::Entry, IndexMap, IndexSet};
+use anyhow::{Context, Result, anyhow, bail};
+use indexmap::{IndexMap, IndexSet, map::Entry};
 use std::hash::{Hash, Hasher};
 use std::mem;
 use wasm_encoder::ExportKind;
 use wasmparser::names::{ComponentName, ComponentNameKind};
 use wasmparser::{
-    types::TypesRef, Encoding, ExternalKind, FuncType, Parser, Payload, TypeRef, ValType,
-    ValidPayload, Validator,
+    Encoding, ExternalKind, FuncType, Parser, Payload, TypeRef, ValType, ValidPayload, Validator,
+    types::TypesRef,
 };
 use wit_parser::{
-    abi::{AbiVariant, WasmSignature, WasmType},
     Function, InterfaceId, PackageName, Resolve, Type, TypeDefKind, TypeId, World, WorldId,
     WorldItem, WorldKey,
+    abi::{AbiVariant, WasmSignature, WasmType},
 };
 
 fn wasm_sig_to_func_type(signature: WasmSignature) -> FuncType {
@@ -1791,19 +1791,11 @@ impl NameMangling for Legacy {
     }
     fn context_get(&self, name: &str) -> Option<u32> {
         let (n, rest) = prefixed_integer(name, "[context-get-")?;
-        if rest.is_empty() {
-            Some(n)
-        } else {
-            None
-        }
+        if rest.is_empty() { Some(n) } else { None }
     }
     fn context_set(&self, name: &str) -> Option<u32> {
         let (n, rest) = prefixed_integer(name, "[context-set-")?;
-        if rest.is_empty() {
-            Some(n)
-        } else {
-            None
-        }
+        if rest.is_empty() { Some(n) } else { None }
     }
     fn module_to_interface(
         &self,
diff --git a/crates/wit-encoder/src/flags.rs b/crates/wit-encoder/src/flags.rs
index ad9ff961..c96502bf 100644
--- a/crates/wit-encoder/src/flags.rs
+++ b/crates/wit-encoder/src/flags.rs
@@ -1,4 +1,4 @@
-use crate::{ident::Ident, Docs};
+use crate::{Docs, ident::Ident};
 
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
diff --git a/crates/wit-encoder/src/function.rs b/crates/wit-encoder/src/function.rs
index 0b752c32..d47654fa 100644
--- a/crates/wit-encoder/src/function.rs
+++ b/crates/wit-encoder/src/function.rs
@@ -1,6 +1,6 @@
 use std::fmt::{self, Display};
 
-use crate::{ident::Ident, Docs, Type};
+use crate::{Docs, Type, ident::Ident};
 
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
diff --git a/crates/wit-encoder/src/package.rs b/crates/wit-encoder/src/package.rs
index cb959c59..1e3a8593 100644
--- a/crates/wit-encoder/src/package.rs
+++ b/crates/wit-encoder/src/package.rs
@@ -2,7 +2,7 @@ use std::fmt;
 
 use semver::Version;
 
-use crate::{ident::Ident, Interface, Render, RenderOpts, World};
+use crate::{Interface, Render, RenderOpts, World, ident::Ident};
 
 /// A WIT package.
 ///
diff --git a/crates/wit-encoder/src/record.rs b/crates/wit-encoder/src/record.rs
index 7bc50508..87dfb6aa 100644
--- a/crates/wit-encoder/src/record.rs
+++ b/crates/wit-encoder/src/record.rs
@@ -1,4 +1,4 @@
-use crate::{ident::Ident, Docs, Type};
+use crate::{Docs, Type, ident::Ident};
 
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
diff --git a/crates/wit-encoder/src/resource.rs b/crates/wit-encoder/src/resource.rs
index 79f8e68d..d17e0f5a 100644
--- a/crates/wit-encoder/src/resource.rs
+++ b/crates/wit-encoder/src/resource.rs
@@ -1,4 +1,4 @@
-use crate::{ident::Ident, Docs, Params, Type};
+use crate::{Docs, Params, Type, ident::Ident};
 
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
diff --git a/crates/wit-encoder/src/ty.rs b/crates/wit-encoder/src/ty.rs
index 18513b53..ef5401eb 100644
--- a/crates/wit-encoder/src/ty.rs
+++ b/crates/wit-encoder/src/ty.rs
@@ -1,8 +1,8 @@
 use std::fmt::{self, Display};
 
 use crate::{
-    ident::Ident, Docs, Enum, EnumCase, Field, Flag, Flags, Record, Render, RenderOpts, Resource,
-    ResourceFunc, Result_, Tuple, Variant,
+    Docs, Enum, EnumCase, Field, Flag, Flags, Record, Render, RenderOpts, Resource, ResourceFunc,
+    Result_, Tuple, Variant, ident::Ident,
 };
 
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
diff --git a/crates/wit-encoder/src/world.rs b/crates/wit-encoder/src/world.rs
index 9fd77cbc..83d9a035 100644
--- a/crates/wit-encoder/src/world.rs
+++ b/crates/wit-encoder/src/world.rs
@@ -1,6 +1,6 @@
 use std::fmt;
 
-use crate::{ident::Ident, Docs, Include, Interface, Render, RenderOpts, StandaloneFunc, Use};
+use crate::{Docs, Include, Interface, Render, RenderOpts, StandaloneFunc, Use, ident::Ident};
 
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
diff --git a/crates/wit-parser/src/ast.rs b/crates/wit-parser/src/ast.rs
index 41186ab3..833bd686 100644
--- a/crates/wit-parser/src/ast.rs
+++ b/crates/wit-parser/src/ast.rs
@@ -1,5 +1,5 @@
 use crate::{Error, PackageNotFoundError, UnresolvedPackageGroup};
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use lex::{Span, Token, Tokenizer};
 use semver::Version;
 use std::borrow::Cow;
diff --git a/crates/wit-parser/src/ast/lex.rs b/crates/wit-parser/src/ast/lex.rs
index 8e86223d..36f4baac 100644
--- a/crates/wit-parser/src/ast/lex.rs
+++ b/crates/wit-parser/src/ast/lex.rs
@@ -1,4 +1,4 @@
-use anyhow::{bail, Result};
+use anyhow::{Result, bail};
 use std::char;
 use std::fmt;
 use std::str;
diff --git a/crates/wit-parser/src/ast/resolve.rs b/crates/wit-parser/src/ast/resolve.rs
index 65994bec..9b718abc 100644
--- a/crates/wit-parser/src/ast/resolve.rs
+++ b/crates/wit-parser/src/ast/resolve.rs
@@ -690,7 +690,7 @@ impl<'a> Resolver<'a> {
 
                 // handled in `resolve_types`
                 ast::WorldItem::Use(_) | ast::WorldItem::Type(_) | ast::WorldItem::Include(_) => {
-                    continue
+                    continue;
                 }
             };
 
@@ -1541,14 +1541,20 @@ impl<'a> Resolver<'a> {
                 deprecated: None,
             }),
 
-            [ast::Attribute::Since { version, .. }, ast::Attribute::Deprecated {
-                version: deprecated,
-                ..
-            }]
-            | [ast::Attribute::Deprecated {
-                version: deprecated,
-                ..
-            }, ast::Attribute::Since { version, .. }] => Ok(Stability::Stable {
+            [
+                ast::Attribute::Since { version, .. },
+                ast::Attribute::Deprecated {
+                    version: deprecated,
+                    ..
+                },
+            ]
+            | [
+                ast::Attribute::Deprecated {
+                    version: deprecated,
+                    ..
+                },
+                ast::Attribute::Since { version, .. },
+            ] => Ok(Stability::Stable {
                 since: version.clone(),
                 deprecated: Some(deprecated.clone()),
             }),
@@ -1558,13 +1564,17 @@ impl<'a> Resolver<'a> {
                 deprecated: None,
             }),
 
-            [ast::Attribute::Unstable { feature, .. }, ast::Attribute::Deprecated { version, .. }]
-            | [ast::Attribute::Deprecated { version, .. }, ast::Attribute::Unstable { feature, .. }] => {
-                Ok(Stability::Unstable {
-                    feature: feature.name.to_string(),
-                    deprecated: Some(version.clone()),
-                })
-            }
+            [
+                ast::Attribute::Unstable { feature, .. },
+                ast::Attribute::Deprecated { version, .. },
+            ]
+            | [
+                ast::Attribute::Deprecated { version, .. },
+                ast::Attribute::Unstable { feature, .. },
+            ] => Ok(Stability::Unstable {
+                feature: feature.name.to_string(),
+                deprecated: Some(version.clone()),
+            }),
             [ast::Attribute::Deprecated { span, .. }] => {
                 bail!(Error::new(
                     *span,
diff --git a/crates/wit-parser/src/decoding.rs b/crates/wit-parser/src/decoding.rs
index 7dce0d1c..6c58ee1e 100644
--- a/crates/wit-parser/src/decoding.rs
+++ b/crates/wit-parser/src/decoding.rs
@@ -5,6 +5,8 @@ use std::mem;
 use std::{collections::HashMap, io::Read};
 use wasmparser::Chunk;
 use wasmparser::{
+    ComponentExternalKind, Parser, Payload, PrimitiveValType, ValidPayload, Validator,
+    WasmFeatures,
     component_types::{
         ComponentAnyTypeId, ComponentDefinedType, ComponentEntityType, ComponentFuncType,
         ComponentInstanceType, ComponentType, ComponentValType,
@@ -12,8 +14,6 @@ use wasmparser::{
     names::{ComponentName, ComponentNameKind},
     types,
     types::Types,
-    ComponentExternalKind, Parser, Payload, PrimitiveValType, ValidPayload, Validator,
-    WasmFeatures,
 };
 
 /// Represents information about a decoded WebAssembly component.
@@ -1469,11 +1469,12 @@ impl WitPackageDecoder<'_> {
 
         let id = self.insert_package(package);
         assert!(self.resolve.worlds.iter().all(|(_, w)| w.package.is_some()));
-        assert!(self
-            .resolve
-            .interfaces
-            .iter()
-            .all(|(_, i)| i.package.is_some()));
+        assert!(
+            self.resolve
+                .interfaces
+                .iter()
+                .all(|(_, i)| i.package.is_some())
+        );
         (self.resolve, id)
     }
 
diff --git a/crates/wit-parser/src/lib.rs b/crates/wit-parser/src/lib.rs
index 32da3e60..43f642ca 100644
--- a/crates/wit-parser/src/lib.rs
+++ b/crates/wit-parser/src/lib.rs
@@ -1,5 +1,5 @@
 use crate::abi::AbiVariant;
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use id_arena::{Arena, Id};
 use indexmap::IndexMap;
 use semver::Version;
@@ -17,9 +17,9 @@ pub use metadata::PackageMetadata;
 
 pub mod abi;
 mod ast;
-use ast::lex::Span;
 pub use ast::SourceMap;
-pub use ast::{parse_use_path, ParsedUsePath};
+use ast::lex::Span;
+pub use ast::{ParsedUsePath, parse_use_path};
 mod sizealign;
 pub use sizealign::*;
 mod resolve;
diff --git a/crates/wit-parser/src/metadata.rs b/crates/wit-parser/src/metadata.rs
index e2632dfa..ff53339b 100644
--- a/crates/wit-parser/src/metadata.rs
+++ b/crates/wit-parser/src/metadata.rs
@@ -18,7 +18,7 @@ use crate::{
     Docs, Function, InterfaceId, PackageId, Resolve, Stability, TypeDefKind, TypeId, WorldId,
     WorldItem, WorldKey,
 };
-use anyhow::{bail, Result};
+use anyhow::{Result, bail};
 use indexmap::IndexMap;
 #[cfg(feature = "serde")]
 use serde_derive::{Deserialize, Serialize};
diff --git a/crates/wit-parser/src/resolve.rs b/crates/wit-parser/src/resolve.rs
index f3acb0eb..bb8b7c92 100644
--- a/crates/wit-parser/src/resolve.rs
+++ b/crates/wit-parser/src/resolve.rs
@@ -5,7 +5,7 @@ use std::fmt;
 use std::mem;
 use std::path::{Path, PathBuf};
 
-use anyhow::{anyhow, bail, Context, Result};
+use anyhow::{Context, Result, anyhow, bail};
 use id_arena::{Arena, Id};
 use indexmap::{IndexMap, IndexSet};
 use semver::Version;
@@ -13,7 +13,7 @@ use semver::Version;
 use serde_derive::Serialize;
 
 use crate::ast::lex::Span;
-use crate::ast::{parse_use_path, ParsedUsePath};
+use crate::ast::{ParsedUsePath, parse_use_path};
 #[cfg(feature = "serde")]
 use crate::serde_::{serialize_arena, serialize_id_map};
 use crate::{
@@ -474,7 +474,7 @@ package {name} is defined in two different locations:\n\
         // wasm file.
         #[cfg(feature = "decoding")]
         {
-            use crate::decoding::{decode, DecodedWasm};
+            use crate::decoding::{DecodedWasm, decode};
 
             #[cfg(feature = "wat")]
             let is_wasm = wat::Detect::from_bytes(&contents).is_wasm();
@@ -1520,11 +1520,7 @@ package {name} is defined in two different locations:\n\
             }))
             .filter_map(move |iface_id| {
                 let pkg = self.interfaces[iface_id].package?;
-                if pkg == id {
-                    None
-                } else {
-                    Some(pkg)
-                }
+                if pkg == id { None } else { Some(pkg) }
             })
     }
 
@@ -3522,7 +3518,10 @@ impl Remap {
         if !names_.is_empty() {
             bail!(Error::new(
                 span,
-                format!("no import or export kebab-name `{}`. Note that an ID does not support renaming", names_[0].name),
+                format!(
+                    "no import or export kebab-name `{}`. Note that an ID does not support renaming",
+                    names_[0].name
+                ),
             ));
         }
 
@@ -4146,16 +4145,22 @@ mod tests {
         assert!(resolve.select_world(dummy, Some("xx")).is_err());
         assert!(resolve.select_world(dummy, Some("")).is_err());
         assert!(resolve.select_world(dummy, Some("foo:bar/foo")).is_ok());
-        assert!(resolve
-            .select_world(dummy, Some("foo:bar/foo@0.1.0"))
-            .is_ok());
+        assert!(
+            resolve
+                .select_world(dummy, Some("foo:bar/foo@0.1.0"))
+                .is_ok()
+        );
         assert!(resolve.select_world(dummy, Some("foo:baz/foo")).is_err());
-        assert!(resolve
-            .select_world(dummy, Some("foo:baz/foo@0.1.0"))
-            .is_ok());
-        assert!(resolve
-            .select_world(dummy, Some("foo:baz/foo@0.2.0"))
-            .is_ok());
+        assert!(
+            resolve
+                .select_world(dummy, Some("foo:baz/foo@0.1.0"))
+                .is_ok()
+        );
+        assert!(
+            resolve
+                .select_world(dummy, Some("foo:baz/foo@0.2.0"))
+                .is_ok()
+        );
         Ok(())
     }
 }
diff --git a/crates/wit-parser/src/serde_.rs b/crates/wit-parser/src/serde_.rs
index 76a14e2b..2b233237 100644
--- a/crates/wit-parser/src/serde_.rs
+++ b/crates/wit-parser/src/serde_.rs
@@ -3,7 +3,7 @@ use id_arena::{Arena, Id};
 use indexmap::IndexMap;
 use semver::Version;
 use serde::ser::{SerializeMap, SerializeSeq, Serializer};
-use serde::{de::Error, Deserialize, Serialize};
+use serde::{Deserialize, Serialize, de::Error};
 
 pub fn serialize_none<S>(serializer: S) -> Result<S::Ok, S::Error>
 where
diff --git a/crates/wit-smith/src/generate.rs b/crates/wit-smith/src/generate.rs
index e350e632..8d240455 100644
--- a/crates/wit-smith/src/generate.rs
+++ b/crates/wit-smith/src/generate.rs
@@ -2,9 +2,9 @@ use crate::config::Config;
 use arbitrary::{Arbitrary, Result, Unstructured};
 use indexmap::{IndexMap, IndexSet};
 use semver::Version;
+use std::collections::HashSet;
 use std::collections::hash_map::{Entry, HashMap};
 use std::collections::hash_set::Intersection;
-use std::collections::HashSet;
 use std::fmt::Write;
 use std::hash::RandomState;
 use std::mem;
diff --git a/fuzz/src/incremental_parse.rs b/fuzz/src/incremental_parse.rs
index 5817cf0f..b02bece6 100644
--- a/fuzz/src/incremental_parse.rs
+++ b/fuzz/src/incremental_parse.rs
@@ -1,6 +1,6 @@
+use Payload::*;
 use arbitrary::{Result, Unstructured};
 use wasmparser::*;
-use Payload::*;
 
 // Simulate receiving chunks of data by fuzzing over a `Vec<Vec<u8>>` where each
 // element of the outer vec is a chunk of data we received.
diff --git a/fuzz/src/lib.rs b/fuzz/src/lib.rs
index 6f34f68b..f6b7a31c 100644
--- a/fuzz/src/lib.rs
+++ b/fuzz/src/lib.rs
@@ -108,7 +108,7 @@ pub fn log_wasm(wasm: &[u8], config: impl Debug) {
 #[cfg(test)]
 mod test {
     use arbitrary::{Result, Unstructured};
-    use rand::{rngs::SmallRng, RngCore, SeedableRng};
+    use rand::{RngCore, SeedableRng, rngs::SmallRng};
 
     fn gen_until_pass(mut f: impl FnMut(&mut Unstructured<'_>) -> Result<bool>) -> bool {
         let mut rng = SmallRng::seed_from_u64(0);
diff --git a/fuzz/src/mutate.rs b/fuzz/src/mutate.rs
index c0c295b4..ef00dd9b 100644
--- a/fuzz/src/mutate.rs
+++ b/fuzz/src/mutate.rs
@@ -282,7 +282,7 @@ mod eval {
                 (Err(e), _) | (_, Err(e))
                     if e.downcast_ref() == Some(&wasmtime::Trap::OutOfFuel) =>
                 {
-                    return false
+                    return false;
                 }
                 (Err(orig), Err(mutated)) => {
                     log::debug!("original error {orig:?}");
diff --git a/fuzz/src/no_traps.rs b/fuzz/src/no_traps.rs
index 9f6f5df4..5540dc20 100644
--- a/fuzz/src/no_traps.rs
+++ b/fuzz/src/no_traps.rs
@@ -48,7 +48,7 @@ pub fn run(u: &mut Unstructured<'_>) -> Result<()> {
             Ok(m) => m,
             // Waiting on wasmtime to get published to fix this.
             Err(e) if format!("{e:?}").contains("unsupported init expr in element section") => {
-                return Ok(())
+                return Ok(());
             }
             Err(e) => panic!("failed to compile module {e:?}"),
         };
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 00000000..c5004667
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1,4 @@
+# This project isn't yet using the 2024 edition due to its MSRV requirement but
+# we're going ahead and opting into the 2024 style edition ahead of updating the
+# Rust edition itself.
+style_edition = '2024'
diff --git a/src/addr2line.rs b/src/addr2line.rs
index 68822c2f..5df52a43 100644
--- a/src/addr2line.rs
+++ b/src/addr2line.rs
@@ -1,7 +1,7 @@
 //! Shared support for `addr2line` and `validate` to parse DWARF sections.
 
 use addr2line::Context;
-use anyhow::{bail, Context as _, Result};
+use anyhow::{Context as _, Result, bail};
 use gimli::EndianSlice;
 use std::collections::HashMap;
 use std::ops::Range;
diff --git a/src/bin/wasm-tools/addr2line.rs b/src/bin/wasm-tools/addr2line.rs
index 9efacce4..e2bfbeca 100644
--- a/src/bin/wasm-tools/addr2line.rs
+++ b/src/bin/wasm-tools/addr2line.rs
@@ -1,5 +1,5 @@
 use addr2line::LookupResult;
-use anyhow::{bail, Context as _, Result};
+use anyhow::{Context as _, Result, bail};
 use std::io::Write;
 use std::u64;
 use wasm_tools::addr2line::Addr2lineModules;
diff --git a/src/bin/wasm-tools/completion.rs b/src/bin/wasm-tools/completion.rs
index 9a6d1ad5..882984be 100644
--- a/src/bin/wasm-tools/completion.rs
+++ b/src/bin/wasm-tools/completion.rs
@@ -1,7 +1,7 @@
 use crate::WasmTools;
 use anyhow::Result;
 use clap::{CommandFactory, Parser};
-use clap_complete::{generate, Shell};
+use clap_complete::{Shell, generate};
 use std::io::stdout;
 
 /// Generate shell completion scripts for this CLI.
diff --git a/src/bin/wasm-tools/component.rs b/src/bin/wasm-tools/component.rs
index 6f488dac..93291e02 100644
--- a/src/bin/wasm-tools/component.rs
+++ b/src/bin/wasm-tools/component.rs
@@ -1,20 +1,20 @@
 //! The WebAssembly component tool command line interface.
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use clap::Parser;
 use std::collections::HashMap;
 use std::io::Read;
 use std::mem;
 use std::path::{Path, PathBuf};
-use wasm_encoder::reencode::{Error, Reencode, ReencodeComponent, RoundtripReencoder};
 use wasm_encoder::ModuleType;
+use wasm_encoder::reencode::{Error, Reencode, ReencodeComponent, RoundtripReencoder};
 use wasm_tools::Output;
 use wasmparser::types::{CoreTypeId, EntityType, Types};
 use wasmparser::{Payload, ValidPayload, WasmFeatures};
 use wat::Detect;
 use wit_component::{
-    embed_component_metadata, metadata, ComponentEncoder, DecodedWasm, Linker, StringEncoding,
-    WitPrinter,
+    ComponentEncoder, DecodedWasm, Linker, StringEncoding, WitPrinter, embed_component_metadata,
+    metadata,
 };
 use wit_parser::{LiftLowerAbi, Mangling, ManglingAndAbi, PackageId, Resolve};
 
@@ -375,7 +375,9 @@ impl EmbedOpts {
                 match mangling {
                     Mangling::Standard32 => {
                         if self.async_callback || self.async_stackful {
-                            bail!("non-legacy mangling not yet supported when generating async dummy modules");
+                            bail!(
+                                "non-legacy mangling not yet supported when generating async dummy modules"
+                            );
                         }
                         ManglingAndAbi::Standard32
                     }
diff --git a/src/bin/wasm-tools/compose.rs b/src/bin/wasm-tools/compose.rs
index 60f8b212..aa0dd280 100644
--- a/src/bin/wasm-tools/compose.rs
+++ b/src/bin/wasm-tools/compose.rs
@@ -55,7 +55,9 @@ impl Opts {
     pub fn run(self) -> Result<()> {
         eprintln!("WARNING: `wasm-tools compose` has been deprecated.");
         eprintln!("");
-        eprintln!("Please use `wac` instead. You can find more information about `wac` at https://github.com/bytecodealliance/wac.");
+        eprintln!(
+            "Please use `wac` instead. You can find more information about `wac` at https://github.com/bytecodealliance/wac."
+        );
         let config = self.create_config()?;
         log::debug!("configuration:\n{:#?}", config);
 
diff --git a/src/bin/wasm-tools/demangle.rs b/src/bin/wasm-tools/demangle.rs
index 65a649fa..e1afeb1a 100644
--- a/src/bin/wasm-tools/demangle.rs
+++ b/src/bin/wasm-tools/demangle.rs
@@ -1,4 +1,4 @@
-use anyhow::{bail, Result};
+use anyhow::{Result, bail};
 use wasm_encoder::{IndirectNameMap, NameMap, NameSection, RawSection};
 use wasmparser::{KnownCustom, Name, NameSectionReader, Parser, Payload::*};
 
diff --git a/src/bin/wasm-tools/dump.rs b/src/bin/wasm-tools/dump.rs
index 8e6a3e4e..42f81c2e 100644
--- a/src/bin/wasm-tools/dump.rs
+++ b/src/bin/wasm-tools/dump.rs
@@ -1,4 +1,4 @@
-use anyhow::{bail, Result};
+use anyhow::{Result, bail};
 use std::fmt::Write as _;
 use std::io::Write;
 use termcolor::{Color, ColorSpec, WriteColor};
diff --git a/src/bin/wasm-tools/json_from_wast.rs b/src/bin/wasm-tools/json_from_wast.rs
index 284507f5..4dd32da7 100644
--- a/src/bin/wasm-tools/json_from_wast.rs
+++ b/src/bin/wasm-tools/json_from_wast.rs
@@ -1,10 +1,10 @@
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use clap::Parser;
 use std::path::{Path, PathBuf};
 use wast::core::{AbstractHeapType, HeapType, NanPattern, V128Const, V128Pattern, WastRetCore};
 use wast::lexer::Lexer;
 use wast::parser::{self, ParseBuffer};
-use wast::token::{Span, F32, F64};
+use wast::token::{F32, F64, Span};
 use wast::{
     QuoteWat, QuoteWatTest, Wast, WastArg, WastDirective, WastExecute, WastInvoke, WastRet,
 };
diff --git a/src/bin/wasm-tools/smith.rs b/src/bin/wasm-tools/smith.rs
index d1ea683f..b76710b8 100644
--- a/src/bin/wasm-tools/smith.rs
+++ b/src/bin/wasm-tools/smith.rs
@@ -1,6 +1,6 @@
 use anyhow::{Context, Result};
 use clap::Parser;
-use std::io::{stdin, Read};
+use std::io::{Read, stdin};
 use std::path::PathBuf;
 use std::process;
 use wasm_smith::Module;
diff --git a/src/bin/wasm-tools/validate.rs b/src/bin/wasm-tools/validate.rs
index 68274f09..216c4384 100644
--- a/src/bin/wasm-tools/validate.rs
+++ b/src/bin/wasm-tools/validate.rs
@@ -1,5 +1,5 @@
 use addr2line::LookupResult;
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use bitflags::Flags;
 use rayon::prelude::*;
 use std::fmt::Write;
diff --git a/src/bin/wasm-tools/wast.rs b/src/bin/wasm-tools/wast.rs
index afcc847c..1917c895 100644
--- a/src/bin/wasm-tools/wast.rs
+++ b/src/bin/wasm-tools/wast.rs
@@ -1,5 +1,5 @@
 use crate::validate::CliFeatures;
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use clap::Parser;
 use rayon::prelude::*;
 use std::fs;
diff --git a/src/bin/wasm-tools/wit_smith.rs b/src/bin/wasm-tools/wit_smith.rs
index bdccea52..81afbdab 100644
--- a/src/bin/wasm-tools/wit_smith.rs
+++ b/src/bin/wasm-tools/wit_smith.rs
@@ -1,6 +1,6 @@
 use anyhow::{Context, Result};
 use clap::Parser;
-use std::io::{stdin, Read};
+use std::io::{Read, stdin};
 use std::path::PathBuf;
 use wit_smith::Config;
 
diff --git a/src/lib.rs b/src/lib.rs
index 8eddb536..97022a37 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,6 +1,6 @@
 //! Shared input/output routines amongst most `wasm-tools` subcommands
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use std::fs::File;
 use std::io::IsTerminal;
 use std::io::{BufWriter, Read, Write};
@@ -231,7 +231,9 @@ impl OutputArg {
                     None => {
                         let mut stdout = std::io::stdout();
                         if stdout.is_terminal() {
-                            bail!("cannot print binary wasm output to a terminal, pass the `-t` flag to print the text format");
+                            bail!(
+                                "cannot print binary wasm output to a terminal, pass the `-t` flag to print the text format"
+                            );
                         }
                         stdout
                             .write_all(bytes)


Test patch:
diff --git a/crates/wasm-compose/tests/compose.rs b/crates/wasm-compose/tests/compose.rs
index 701bdbe9..d7319379 100644
--- a/crates/wasm-compose/tests/compose.rs
+++ b/crates/wasm-compose/tests/compose.rs
@@ -1,4 +1,4 @@
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use pretty_assertions::assert_eq;
 use std::fs;
 use std::io;
diff --git a/crates/wasm-smith/tests/available_imports.rs b/crates/wasm-smith/tests/available_imports.rs
index 566ff377..851dbdc3 100644
--- a/crates/wasm-smith/tests/available_imports.rs
+++ b/crates/wasm-smith/tests/available_imports.rs
@@ -1,7 +1,7 @@
 #![cfg(feature = "wasmparser")]
 
 use arbitrary::Unstructured;
-use rand::{rngs::SmallRng, RngCore, SeedableRng};
+use rand::{RngCore, SeedableRng, rngs::SmallRng};
 use std::collections::HashMap;
 use wasm_smith::{Config, Module};
 use wasmparser::Validator;
@@ -139,9 +139,9 @@ fn import_config(
     config.exceptions_enabled = u.arbitrary().expect("exceptions enabled for swarm");
     let available = {
         use {
-            wasmparser::{PackedIndex, RefType},
             AvailableImportKind::*,
             ValType::*,
+            wasmparser::{PackedIndex, RefType},
         };
         vec![
             ("env", "pi", Func(vec![I32], vec![])),
diff --git a/crates/wasm-smith/tests/common/mod.rs b/crates/wasm-smith/tests/common/mod.rs
index 7598f868..753b0be6 100644
--- a/crates/wasm-smith/tests/common/mod.rs
+++ b/crates/wasm-smith/tests/common/mod.rs
@@ -1,4 +1,4 @@
-use wasmparser::{types::Types, Validator};
+use wasmparser::{Validator, types::Types};
 
 pub fn validate(validator: &mut Validator, bytes: &[u8]) -> Types {
     let err = match validator.validate_all(bytes) {
diff --git a/crates/wasm-smith/tests/component.rs b/crates/wasm-smith/tests/component.rs
index 486fd3c8..cba22079 100644
--- a/crates/wasm-smith/tests/component.rs
+++ b/crates/wasm-smith/tests/component.rs
@@ -1,7 +1,7 @@
 #![cfg(feature = "component-model")]
 
 use arbitrary::{Arbitrary, Unstructured};
-use rand::{rngs::SmallRng, RngCore, SeedableRng};
+use rand::{RngCore, SeedableRng, rngs::SmallRng};
 use wasm_smith::Component;
 
 #[test]
diff --git a/crates/wasm-smith/tests/core.rs b/crates/wasm-smith/tests/core.rs
index 3a761546..1cb8acd1 100644
--- a/crates/wasm-smith/tests/core.rs
+++ b/crates/wasm-smith/tests/core.rs
@@ -1,5 +1,5 @@
 use arbitrary::{Arbitrary, Unstructured};
-use rand::{rngs::SmallRng, RngCore, SeedableRng};
+use rand::{RngCore, SeedableRng, rngs::SmallRng};
 use wasm_smith::{Config, Module};
 use wasmparser::{Validator, WasmFeatures};
 
diff --git a/crates/wasm-smith/tests/exports.rs b/crates/wasm-smith/tests/exports.rs
index e98b22a8..83f8be38 100644
--- a/crates/wasm-smith/tests/exports.rs
+++ b/crates/wasm-smith/tests/exports.rs
@@ -1,11 +1,11 @@
 #![cfg(feature = "wasmparser")]
 
 use arbitrary::Unstructured;
-use rand::{rngs::SmallRng, RngCore, SeedableRng};
+use rand::{RngCore, SeedableRng, rngs::SmallRng};
 use wasm_smith::{Config, Module};
 use wasmparser::{
-    types::EntityType, CompositeType, FuncType, GlobalType, MemoryType, Parser, TableType,
-    Validator, WasmFeatures,
+    CompositeType, FuncType, GlobalType, MemoryType, Parser, TableType, Validator, WasmFeatures,
+    types::EntityType,
 };
 
 mod common;
diff --git a/crates/wasm-wave/tests/ui.rs b/crates/wasm-wave/tests/ui.rs
index b238192f..b12fad2d 100644
--- a/crates/wasm-wave/tests/ui.rs
+++ b/crates/wasm-wave/tests/ui.rs
@@ -4,7 +4,7 @@ use std::{collections::HashMap, fmt::Write, fs, path::Path, sync::OnceLock};
 use wasm_wave::{
     parser::ParserError,
     untyped::UntypedFuncCall,
-    value::{resolve_wit_func_type, FuncType, Value},
+    value::{FuncType, Value, resolve_wit_func_type},
     wasm::{DisplayValue, WasmFunc},
 };
 use wit_parser::Resolve;
diff --git a/crates/wit-component/tests/components.rs b/crates/wit-component/tests/components.rs
index 4cb35508..530c5d0c 100644
--- a/crates/wit-component/tests/components.rs
+++ b/crates/wit-component/tests/components.rs
@@ -1,4 +1,4 @@
-use anyhow::{bail, Context, Error, Result};
+use anyhow::{Context, Error, Result, bail};
 use libtest_mimic::{Arguments, Trial};
 use pretty_assertions::assert_eq;
 use std::{borrow::Cow, fs, path::Path};
diff --git a/crates/wit-component/tests/linking.rs b/crates/wit-component/tests/linking.rs
index fdc020ab..c667a7ad 100644
--- a/crates/wit-component/tests/linking.rs
+++ b/crates/wit-component/tests/linking.rs
@@ -186,8 +186,8 @@ fn linking() -> Result<()> {
         use {
             anyhow::anyhow,
             wasmtime::{
-                component::{Component, Linker},
                 Config, Engine, Store,
+                component::{Component, Linker},
             },
         };
 
diff --git a/crates/wit-component/tests/wit.rs b/crates/wit-component/tests/wit.rs
index 20dddf28..a1c9a2f3 100644
--- a/crates/wit-component/tests/wit.rs
+++ b/crates/wit-component/tests/wit.rs
@@ -10,9 +10,11 @@ fn parse_wit_dir() -> Result<()> {
 
     let mut resolver = Resolve::default();
     let (package_id, _) = resolver.push_path("tests/wit/parse-dir/wit")?;
-    assert!(resolver
-        .select_world(package_id, "foo-world".into())
-        .is_ok());
+    assert!(
+        resolver
+            .select_world(package_id, "foo-world".into())
+            .is_ok()
+    );
 
     Ok(())
 }
@@ -25,10 +27,12 @@ fn parse_wit_file() -> Result<()> {
     let mut resolver = Resolve::default();
     let (package_id, _) = resolver.push_path("tests/wit/parse-dir/wit/deps/bar/bar.wit")?;
     resolver.select_world(package_id, "bar-world".into())?;
-    assert!(resolver
-        .interfaces
-        .iter()
-        .any(|(_, iface)| iface.name == Some("bar".into())));
+    assert!(
+        resolver
+            .interfaces
+            .iter()
+            .any(|(_, iface)| iface.name == Some("bar".into()))
+    );
 
     Ok(())
 }
diff --git a/crates/wit-encoder/tests/deps.rs b/crates/wit-encoder/tests/deps.rs
index 36cc145e..537928dc 100644
--- a/crates/wit-encoder/tests/deps.rs
+++ b/crates/wit-encoder/tests/deps.rs
@@ -1,6 +1,6 @@
 use anyhow::Result;
 use pretty_assertions::assert_eq;
-use wit_encoder::{packages_from_parsed, Package};
+use wit_encoder::{Package, packages_from_parsed};
 use wit_parser::Resolve;
 
 const MAIN_PACKAGE_SOURCE: &str = indoc::indoc! {"
diff --git a/crates/wit-parser/tests/all.rs b/crates/wit-parser/tests/all.rs
index 1a4cd9d9..ac712bb6 100644
--- a/crates/wit-parser/tests/all.rs
+++ b/crates/wit-parser/tests/all.rs
@@ -7,7 +7,7 @@
 //!
 //!     cargo test --test all foo.wit
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use libtest_mimic::{Arguments, Trial};
 use pretty_assertions::StrComparison;
 use std::env;
diff --git a/tests/cli.rs b/tests/cli.rs
index daef458c..445cb6e6 100644
--- a/tests/cli.rs
+++ b/tests/cli.rs
@@ -5,7 +5,7 @@
 //! directives and features of this test suite see the `tests/cli/readme.wat`
 //! file which has an explanatory comment at the top for what's going on.
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use indexmap::IndexMap;
 use libtest_mimic::{Arguments, Trial};
 use pretty_assertions::StrComparison;