Skip to content

Commit

Permalink
derive: use hygenic path for Result in output
Browse files Browse the repository at this point in the history
This stops conflicts with too many generics when type
aliases of `Result` are in scope.
  • Loading branch information
spikespaz committed Dec 30, 2024
1 parent 163f329 commit ebce72a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions derive/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ pub fn emit_struct(s: &Struct, named: bool) -> syn::Result<TokenStream> {
fn insert_child(&mut self,
#node: &::knus::ast::SpannedNode<#span_ty>,
#ctx: &mut ::knus::decode::Context<#span_ty>)
-> Result<bool, ::knus::errors::DecodeError<#span_ty>>
-> ::std::result::Result<bool, ::knus::errors::DecodeError<#span_ty>>
{
#insert_child
}
fn insert_property(&mut self,
#name: &::knus::span::Spanned<Box<str>, #span_ty>,
#value: &::knus::ast::Value<#span_ty>,
#ctx: &mut ::knus::decode::Context<#span_ty>)
-> Result<bool, ::knus::errors::DecodeError<#span_ty>>
-> ::std::result::Result<bool, ::knus::errors::DecodeError<#span_ty>>
{
#insert_property
}
Expand All @@ -124,7 +124,7 @@ pub fn emit_struct(s: &Struct, named: bool) -> syn::Result<TokenStream> {
fn decode_children(
#children: &[::knus::ast::SpannedNode<#span_ty>],
#ctx: &mut ::knus::decode::Context<#span_ty>)
-> Result<Self, ::knus::errors::DecodeError<#span_ty>>
-> ::std::result::Result<Self, ::knus::errors::DecodeError<#span_ty>>
{
#decode_children
#assign_extra
Expand All @@ -140,7 +140,7 @@ pub fn emit_struct(s: &Struct, named: bool) -> syn::Result<TokenStream> {
{
fn decode_node(#node: &::knus::ast::SpannedNode<#span_ty>,
#ctx: &mut ::knus::decode::Context<#span_ty>)
-> Result<Self, ::knus::errors::DecodeError<#span_ty>>
-> ::std::result::Result<Self, ::knus::errors::DecodeError<#span_ty>>
{
#decode_specials
#decode_args
Expand All @@ -164,7 +164,7 @@ pub fn emit_new_type(s: &NewType) -> syn::Result<TokenStream> {
{
fn decode_node(#node: &::knus::ast::SpannedNode<S>,
#ctx: &mut ::knus::decode::Context<S>)
-> Result<Self, ::knus::errors::DecodeError<S>>
-> ::std::result::Result<Self, ::knus::errors::DecodeError<S>>
{
if #node.arguments.len() > 0 ||
#node.properties.len() > 0 ||
Expand Down
2 changes: 1 addition & 1 deletion derive/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn emit_enum(e: &Enum) -> syn::Result<TokenStream> {
fn raw_decode(val: &::knus::span::Spanned<
::knus::ast::Literal, S>,
ctx: &mut ::knus::decode::Context<S>)
-> Result<#e_name, ::knus::errors::DecodeError<S>>
-> ::std::result::Result<#e_name, ::knus::errors::DecodeError<S>>
{
match &**val {
::knus::ast::Literal::String(ref s) => {
Expand Down
2 changes: 1 addition & 1 deletion derive/src/variants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn emit_enum(e: &Enum) -> syn::Result<TokenStream> {
{
fn decode_node(#node: &::knus::ast::SpannedNode<#span_ty>,
#ctx: &mut ::knus::decode::Context<#span_ty>)
-> Result<Self, ::knus::errors::DecodeError<#span_ty>>
-> ::std::result::Result<Self, ::knus::errors::DecodeError<#span_ty>>
{
#decode
}
Expand Down

0 comments on commit ebce72a

Please sign in to comment.