From 040b46fe8dabe198c9210ff917a914a7d82c47a5 Mon Sep 17 00:00:00 2001 From: Artem Romanenia Date: Mon, 18 Nov 2024 11:58:46 +0300 Subject: [PATCH] use spelled out Result in expanded code --- Cargo.toml | 6 +++--- o2o-impl/Cargo.toml | 2 +- o2o-impl/src/expand.rs | 6 +++--- o2o-impl/src/tests.rs | 24 ++++++++++++------------ o2o-macros/Cargo.toml | 4 ++-- o2o-tests/Cargo.toml | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index acefd47..96e4e30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "o2o" -version = "0.4.10" +version = "0.4.11" edition = "2021" authors = ["Artem Romanenia "] categories = ["rust-patterns"] @@ -10,8 +10,8 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/Artem-Romanenia/o2o" [dependencies] -o2o-impl = { version = "0.4.10", path = "o2o-impl", optional = true } -o2o-macros = { version = "0.4.10", path = "o2o-macros", optional = true } +o2o-impl = { version = "0.4.11", path = "o2o-impl", optional = true } +o2o-macros = { version = "0.4.11", path = "o2o-macros", optional = true } [features] default = ["macro"] diff --git a/o2o-impl/Cargo.toml b/o2o-impl/Cargo.toml index 6812fa0..0b11076 100644 --- a/o2o-impl/Cargo.toml +++ b/o2o-impl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "o2o-impl" -version = "0.4.10" +version = "0.4.11" edition = "2021" authors = ["Artem Romanenia "] description = "Implementation of 'o2o' crate" diff --git a/o2o-impl/src/expand.rs b/o2o-impl/src/expand.rs index 64c0eb8..3bfee8c 100644 --- a/o2o-impl/src/expand.rs +++ b/o2o-impl/src/expand.rs @@ -1131,7 +1131,7 @@ fn quote_try_from_trait(input: &DataType, ctx: &ImplContext, pre_init: Option for #dst #these_gens #where_clause { type Error = #err_ty; #attr - fn try_from(value: #r #src #those_gens) -> Result<#dst #these_gens, #err_ty> { + fn try_from(value: #r #src #those_gens) -> ::core::result::Result<#dst #these_gens, #err_ty> { #inner_attr #pre_init #init @@ -1190,7 +1190,7 @@ fn quote_try_into_trait(input: &DataType, ctx: &ImplContext, pre_init: Option for #r #src #these_gens #where_clause { type Error = #err_ty; #attr - fn try_into(self) -> Result<#dst #those_gens, #err_ty> { + fn try_into(self) -> ::core::result::Result<#dst #those_gens, #err_ty> { #inner_attr #body } @@ -1222,7 +1222,7 @@ fn quote_try_into_existing_trait(input: &DataType, ctx: &ImplContext, pre_init: impl #impl_gens o2o::traits::TryIntoExisting<#dst #those_gens> for #r #src #these_gens #where_clause { type Error = #err_ty; #attr - fn try_into_existing(self, other: &mut #dst #those_gens) -> Result<(), #err_ty> { + fn try_into_existing(self, other: &mut #dst #those_gens) -> ::core::result::Result<(), #err_ty> { #inner_attr #pre_init #init diff --git a/o2o-impl/src/tests.rs b/o2o-impl/src/tests.rs index 0f36e81..ac62188 100644 --- a/o2o-impl/src/tests.rs +++ b/o2o-impl/src/tests.rs @@ -1804,7 +1804,7 @@ quote!{ impl ::core::convert::TryFrom for Test { type Error = String; #[attribute(param)] - fn try_from(value: TestDto) -> Result { + fn try_from(value: TestDto) -> ::core::result::Result { #![inner_param(param)] Ok(Test { x: value.x, }) } @@ -1813,7 +1813,7 @@ quote!{ impl ::core::convert::TryFrom<&TestDto> for Test { type Error = String; #[attribute(param)] - fn try_from(value: &TestDto) -> Result { + fn try_from(value: &TestDto) -> ::core::result::Result { #![inner_param(param)] Ok(Test { x: value.x, }) } @@ -1822,7 +1822,7 @@ quote!{ impl ::core::convert::TryInto for Test { type Error = String; #[attribute(param)] - fn try_into(self) -> Result { + fn try_into(self) -> ::core::result::Result { #![inner_param(param)] Ok(TestDto { x: self.x, }) } @@ -1831,7 +1831,7 @@ quote!{ impl ::core::convert::TryInto for &Test { type Error = String; #[attribute(param)] - fn try_into(self) -> Result { + fn try_into(self) -> ::core::result::Result { #![inner_param(param)] Ok(TestDto { x: self.x, }) } @@ -1840,7 +1840,7 @@ quote!{ impl o2o::traits::TryIntoExisting for Test { type Error = String; #[attribute(param)] - fn try_into_existing(self, other: &mut TestDto) -> Result<(), String> { + fn try_into_existing(self, other: &mut TestDto) -> ::core::result::Result<(), String> { #![inner_param(param)] other.x = self.x; Ok(()) @@ -1850,7 +1850,7 @@ quote!{ impl o2o::traits::TryIntoExisting for &Test { type Error = String; #[attribute(param)] - fn try_into_existing(self, other: &mut TestDto) -> Result<(), String> { + fn try_into_existing(self, other: &mut TestDto) -> ::core::result::Result<(), String> { #![inner_param(param)] other.x = self.x; Ok(()) @@ -2061,7 +2061,7 @@ quote!{ where 'c: 'a, 'd: 'b, 'a: 'c, 'b: 'd { type Error = String; - fn try_from(value: Entity<'c, 'd>) -> Result, String> { + fn try_from(value: Entity<'c, 'd>) -> ::core::result::Result, String> { Ok(EntityDto { some_int: value.some_int, some_str: value.some_str, @@ -2073,7 +2073,7 @@ quote!{ where 'c: 'a, 'd: 'b, 'a: 'c, 'b: 'd { type Error = String; - fn try_from(value: &'o2o Entity<'c, 'd>) -> Result, String> { + fn try_from(value: &'o2o Entity<'c, 'd>) -> ::core::result::Result, String> { Ok(EntityDto { some_int: value.some_int, some_str: value.some_str, @@ -2085,7 +2085,7 @@ quote!{ where 'c: 'a, 'd: 'b, 'a: 'c, 'b: 'd { type Error = String; - fn try_into(self) -> Result, String> { + fn try_into(self) -> ::core::result::Result, String> { Ok(Entity { some_int: self.some_int, some_str: self.some_str, @@ -2097,7 +2097,7 @@ quote!{ where 'c: 'a, 'd: 'b, 'a: 'c, 'b: 'd { type Error = String; - fn try_into(self) -> Result, String> { + fn try_into(self) -> ::core::result::Result, String> { Ok(Entity { some_int: self.some_int, some_str: self.some_str, @@ -2109,7 +2109,7 @@ quote!{ where 'c: 'a, 'd: 'b, 'a: 'c, 'b: 'd { type Error = String; - fn try_into_existing(self, other: &mut Entity<'c, 'd>) -> Result<(), String> { + fn try_into_existing(self, other: &mut Entity<'c, 'd>) -> ::core::result::Result<(), String> { other.some_int = self.some_int; other.some_str = self.some_str; other.another_str = "123".into(); @@ -2120,7 +2120,7 @@ quote!{ where 'c: 'a, 'd: 'b, 'a: 'c, 'b: 'd { type Error = String; - fn try_into_existing(self, other: &mut Entity<'c, 'd>) -> Result<(), String> { + fn try_into_existing(self, other: &mut Entity<'c, 'd>) -> ::core::result::Result<(), String> { other.some_int = self.some_int; other.some_str = self.some_str; other.another_str = "321".into(); diff --git a/o2o-macros/Cargo.toml b/o2o-macros/Cargo.toml index 896d665..0169aec 100644 --- a/o2o-macros/Cargo.toml +++ b/o2o-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "o2o-macros" -version = "0.4.10" +version = "0.4.11" edition = "2021" authors = ["Artem Romanenia "] description = "Macro definitions of 'o2o' crate" @@ -11,5 +11,5 @@ repository = "https://github.com/Artem-Romanenia/o2o" proc-macro = true [dependencies] -o2o-impl = { version = "0.4.10", path = "../o2o-impl" } +o2o-impl = { version = "0.4.11", path = "../o2o-impl" } syn = "1.0.3" diff --git a/o2o-tests/Cargo.toml b/o2o-tests/Cargo.toml index 0f08bf3..0eca967 100644 --- a/o2o-tests/Cargo.toml +++ b/o2o-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "o2o-tests" -version = "0.4.10" +version = "0.4.11" edition = "2021" authors = ["Artem Romanenia "] description = "Tests for 'o2o' crate" @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/Artem-Romanenia/o2o" [dependencies] -o2o = { version = "0.4.10", path = "../" } +o2o = { version = "0.4.11", path = "../" } anyhow = "1.0.86" [dev-dependencies]