Skip to content

Commit

Permalink
fix(derive): use full path for Result in quote
Browse files Browse the repository at this point in the history
If there was a custom result type in where the derive was used, the
macro would error since the type is not the one in from std exported in
the prelude. Now we use the type full path to prevent errors.

Signed-off-by: Joshua Chapman <[email protected]>
  • Loading branch information
joshuachp committed Sep 23, 2024
1 parent d149a51 commit eaff0c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions astarte-device-sdk-derive/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl FromEventDerive {
impl #impl_generics astarte_device_sdk::FromEvent for #name #ty_generics #where_clause {
type Err = astarte_device_sdk::event::FromEventError;

fn from_event(event: astarte_device_sdk::DeviceEvent) -> Result<Self, Self::Err> {
fn from_event(event: astarte_device_sdk::DeviceEvent) -> ::std::result::Result<Self, Self::Err> {
use astarte_device_sdk::Value;
use astarte_device_sdk::event::FromEventError;
use astarte_device_sdk::interface::mapping::endpoint::Endpoint;
Expand Down Expand Up @@ -276,7 +276,7 @@ impl FromEventDerive {
impl #impl_generics astarte_device_sdk::FromEvent for #name #ty_generics #where_clause {
type Err = astarte_device_sdk::event::FromEventError;

fn from_event(event: astarte_device_sdk::DeviceEvent) -> Result<Self, Self::Err> {
fn from_event(event: astarte_device_sdk::DeviceEvent) -> ::std::result::Result<Self, Self::Err> {
use astarte_device_sdk::Value;
use astarte_device_sdk::AstarteType;
use astarte_device_sdk::event::FromEventError;
Expand Down
2 changes: 1 addition & 1 deletion astarte-device-sdk-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl AggregateDerive {
impl #impl_generics astarte_device_sdk::AstarteAggregate for #name #ty_generics #where_clause {
fn astarte_aggregate(
self,
) -> Result<
) -> ::std::result::Result<
std::collections::HashMap<String, astarte_device_sdk::types::AstarteType>,
astarte_device_sdk::error::Error,
> {
Expand Down

0 comments on commit eaff0c9

Please sign in to comment.