Skip to content

Commit

Permalink
Merge #445
Browse files Browse the repository at this point in the history
445: Ensure the `with_prefix!` macro uses properly namespaced items r=jonasbb a=jonasbb

bors merge

Co-authored-by: Jonas Bushart <[email protected]>
  • Loading branch information
bors[bot] and jonasbb authored May 2, 2022
2 parents 75eaec0 + 7ebf7ac commit d646aab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serde_with/src/with_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ macro_rules! with_prefix {
use $crate::with_prefix::WithPrefix;

#[allow(dead_code)]
pub fn serialize<T, S>(object: &T, serializer: S) -> Result<S::Ok, S::Error>
pub fn serialize<T, S>(object: &T, serializer: S) -> ::std::result::Result<S::Ok, S::Error>
where
T: Serialize,
S: Serializer,
Expand All @@ -126,7 +126,7 @@ macro_rules! with_prefix {
}

#[allow(dead_code)]
pub fn deserialize<'de, T, D>(deserializer: D) -> Result<T, D::Error>
pub fn deserialize<'de, T, D>(deserializer: D) -> ::std::result::Result<T, D::Error>
where
T: Deserialize<'de>,
D: Deserializer<'de>,
Expand Down
9 changes: 9 additions & 0 deletions serde_with_test/tests/with_prefix.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//! Test that the with_prefix macros properly name all the types and traits used

// Ensure no prelude is available
#![no_implicit_prelude]
#![allow(dead_code, unused_imports)]

use ::s_with::with_prefix;

with_prefix!(prefix_foobar "foobar_");

0 comments on commit d646aab

Please sign in to comment.