From 2b9256e3bf9ae3dca7007c5ce6af5ed32b6536ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Istv=C3=A1n=20B=C3=ADr=C3=B3?= Date: Tue, 3 Dec 2024 19:16:49 +0100 Subject: [PATCH 1/3] Pin poem-openapi --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15242af..d0ce9ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1512,9 +1512,9 @@ dependencies = [ [[package]] name = "poem-openapi" -version = "5.1.2" +version = "5.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c354a706a81a17657da8441869c6ce3d486ef5e72705919d6035fb038a6f7b5" +checksum = "d92bcce356da677d56723f1f2017276457659d6b93abdcf3ebb218b5050f5bc6" dependencies = [ "base64 0.22.1", "bytes", @@ -1537,9 +1537,9 @@ dependencies = [ [[package]] name = "poem-openapi-derive" -version = "5.1.1" +version = "5.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88e4cd0c926ab1d9a015ecc1077c950d5897577554691ff70efcd9c90ddeb614" +checksum = "6c59f3a8822f162875cc5de29c8cd911e367a79078b06a9fedc081e1f259dd24" dependencies = [ "darling", "http", diff --git a/Cargo.toml b/Cargo.toml index b971750..4862133 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ description = "WASM AST" bincode = { version = "2.0.0-rc.3", optional = true } leb128 = { version = "0.2.5", optional = true } mappable-rc = "0.1.1" -poem-openapi = { version = "5.0", optional = true } +poem-openapi = { version = "=5.1.3", optional = true } prost = { version = "0.12", optional = true } serde = { version = "1.0", optional = true, features = ["derive"] } serde_json = { version = "1.0", optional = true } From 6ab665d55fa95cf91c093a9979abbfaed2476037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Istv=C3=A1n=20B=C3=ADr=C3=B3?= Date: Tue, 3 Dec 2024 19:22:07 +0100 Subject: [PATCH 2/3] clippy --- src/component/mod.rs | 1 + src/component/parser.rs | 26 +++++++++++++------------- src/core/parser.rs | 22 +++++++++++----------- src/core/writer.rs | 2 +- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/component/mod.rs b/src/component/mod.rs index fbb924f..e484c39 100644 --- a/src/component/mod.rs +++ b/src/component/mod.rs @@ -32,6 +32,7 @@ pub mod writer; /// The Component Model section nodes. /// /// See [Section] for more information. +#[allow(clippy::large_enum_variant)] #[derive(Debug, Clone, PartialEq)] pub enum ComponentSection { Module(Module), diff --git a/src/component/parser.rs b/src/component/parser.rs index cc9a446..8fe4ece 100644 --- a/src/component/parser.rs +++ b/src/component/parser.rs @@ -17,7 +17,7 @@ use crate::core::{Data, TryFromExprSource}; use crate::Sections; use wasmparser::{Chunk, Parser, Payload}; -impl<'a> TryFrom> for InstantiationArg { +impl TryFrom> for InstantiationArg { type Error = String; fn try_from(value: wasmparser::InstantiationArg) -> Result { @@ -33,7 +33,7 @@ impl<'a> TryFrom> for InstantiationArg { } } -impl<'a> TryFrom> for Instance { +impl TryFrom> for Instance { type Error = String; fn try_from(value: wasmparser::Instance) -> Result { @@ -65,7 +65,7 @@ impl TryFrom for OuterAliasKind { } } -impl<'a> TryFrom> for ModuleDeclaration { +impl TryFrom> for ModuleDeclaration { type Error = String; fn try_from(value: wasmparser::ModuleTypeDeclaration) -> Result { @@ -112,7 +112,7 @@ impl TryFrom for FuncType { } } -impl<'a> TryFrom> for CoreType { +impl TryFrom> for CoreType { type Error = String; fn try_from(value: wasmparser::CoreType) -> Result { @@ -158,7 +158,7 @@ impl<'a> TryFrom> for ComponentInstant } } -impl<'a> TryFrom> for ComponentExternName { +impl TryFrom> for ComponentExternName { type Error = String; fn try_from(value: wasmparser::ComponentExportName) -> Result { @@ -257,7 +257,7 @@ impl<'a> TryFrom> for ComponentExport { } } -impl<'a> TryFrom> for ComponentInstance { +impl TryFrom> for ComponentInstance { type Error = String; fn try_from(value: wasmparser::ComponentInstance) -> Result { @@ -344,7 +344,7 @@ impl<'a> TryFrom> for Alias { } } -impl<'a> TryFrom> for VariantCase { +impl TryFrom> for VariantCase { type Error = String; fn try_from(value: wasmparser::VariantCase) -> Result { @@ -359,7 +359,7 @@ impl<'a> TryFrom> for VariantCase { } } -impl<'a> TryFrom> for ComponentDefinedType { +impl TryFrom> for ComponentDefinedType { type Error = String; fn try_from(value: wasmparser::ComponentDefinedType) -> Result { @@ -431,7 +431,7 @@ impl<'a> TryFrom> for ComponentDefinedType } } -impl<'a> TryFrom> for ComponentFuncResult { +impl TryFrom> for ComponentFuncResult { type Error = String; fn try_from(value: wasmparser::ComponentFuncResult) -> Result { @@ -449,7 +449,7 @@ impl<'a> TryFrom> for ComponentFuncResult { } } -impl<'a> TryFrom> for ComponentFuncType { +impl TryFrom> for ComponentFuncType { type Error = String; fn try_from(value: wasmparser::ComponentFuncType) -> Result { @@ -464,7 +464,7 @@ impl<'a> TryFrom> for ComponentFuncType { } } -impl<'a> TryFrom> for ComponentExternName { +impl TryFrom> for ComponentExternName { type Error = String; fn try_from(value: wasmparser::ComponentImportName) -> Result { @@ -472,7 +472,7 @@ impl<'a> TryFrom> for ComponentExternName { } } -impl<'a> TryFrom> for ComponentImport { +impl TryFrom> for ComponentImport { type Error = String; fn try_from(value: wasmparser::ComponentImport) -> Result { @@ -534,7 +534,7 @@ impl<'a> TryFrom> for InstanceTypeDeclar } } -impl<'a> TryFrom> for ComponentType { +impl TryFrom> for ComponentType { type Error = String; fn try_from(value: wasmparser::ComponentType) -> Result { diff --git a/src/core/parser.rs b/src/core/parser.rs index 068e23e..d2c6ce0 100644 --- a/src/core/parser.rs +++ b/src/core/parser.rs @@ -129,7 +129,7 @@ impl TryFrom for TypeRef { } } -impl<'a> TryFrom> for Import { +impl TryFrom> for Import { type Error = String; fn try_from(value: wasmparser::Import) -> Result { @@ -141,7 +141,7 @@ impl<'a> TryFrom> for Import { } } -impl<'a> TryFrom> for Table { +impl TryFrom> for Table { type Error = String; fn try_from(value: wasmparser::Table) -> Result { @@ -227,7 +227,7 @@ impl TryFrom for RefType { } } -impl<'a> TryFrom> for Export { +impl TryFrom> for Export { type Error = String; fn try_from(value: wasmparser::Export) -> Result { @@ -247,7 +247,7 @@ impl<'a> TryFrom> for Export { } } -impl<'a> TryFrom> for ElemMode { +impl TryFrom> for ElemMode { type Error = String; fn try_from(value: wasmparser::ElementKind) -> Result { @@ -265,7 +265,7 @@ impl<'a> TryFrom> for ElemMode { } } -impl<'a, T: TryFromExprSource> TryFrom> for Elem { +impl TryFrom> for Elem { type Error = String; fn try_from(value: wasmparser::Element) -> Result { @@ -302,7 +302,7 @@ impl<'a, T: TryFromExprSource> TryFrom> for Elem { } } -impl<'a, T: TryFromExprSource + Debug + Clone + PartialEq> TryFrom> +impl TryFrom> for DataMode { type Error = String; @@ -325,7 +325,7 @@ impl<'a, T: TryFromExprSource + Debug + Clone + PartialEq> TryFrom TryFrom> +impl TryFrom> for Data { type Error = String; @@ -338,7 +338,7 @@ impl<'a, T: TryFromExprSource + Debug + Clone + PartialEq> TryFrom TryFrom> for FuncCode { +impl TryFrom> for FuncCode { type Error = String; fn try_from(value: wasmparser::FunctionBody) -> Result { @@ -387,7 +387,7 @@ impl OperatorTarget { } } -impl<'a> TryFrom> for Expr { +impl TryFrom> for Expr { type Error = String; fn try_from(value: OperatorsReader) -> Result { @@ -1852,7 +1852,7 @@ impl<'a> OperatorsReaderExprSource<'a> { } } -impl<'a> ExprSource for OperatorsReaderExprSource<'a> { +impl ExprSource for OperatorsReaderExprSource<'_> { fn unparsed(self) -> Result, String> { let binary_reader: BinaryReader = self.reader.get_binary_reader(); let range = binary_reader.range(); @@ -1863,7 +1863,7 @@ impl<'a> ExprSource for OperatorsReaderExprSource<'a> { } } -impl<'a> IntoIterator for OperatorsReaderExprSource<'a> { +impl IntoIterator for OperatorsReaderExprSource<'_> { type Item = Result; type IntoIter = Box>>; diff --git a/src/core/writer.rs b/src/core/writer.rs index ef91d38..025117c 100644 --- a/src/core/writer.rs +++ b/src/core/writer.rs @@ -352,7 +352,7 @@ fn add_to_import_section(section: &mut wasm_encoder::ImportSection, value: &Impo section.import(&value.module, &value.name, entity_type); } -impl<'a> From for wasm_encoder::CustomSection<'a> { +impl From for wasm_encoder::CustomSection<'_> { fn from(value: Custom) -> Self { wasm_encoder::CustomSection { name: value.name.into(), From e506bb60a3af9ba03382f014c6637f192a29809b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Istv=C3=A1n=20B=C3=ADr=C3=B3?= Date: Tue, 3 Dec 2024 19:25:09 +0100 Subject: [PATCH 3/3] fmt --- src/core/parser.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/parser.rs b/src/core/parser.rs index d2c6ce0..cdd7d2e 100644 --- a/src/core/parser.rs +++ b/src/core/parser.rs @@ -325,9 +325,7 @@ impl TryFrom TryFrom> - for Data -{ +impl TryFrom> for Data { type Error = String; fn try_from(value: wasmparser::Data) -> Result {