summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Korber <p.korber@1aim.com>2018-12-04 16:12:17 +0100
committerPhilipp Korber <p.korber@1aim.com>2018-12-04 16:12:17 +0100
commit665f858bf5176d18d6fe952fa77221178d8a0a37 (patch)
treede917fb898bf01aa28e556535b6c08738d7f1936
parent7be694177c3f264fa552822cc6f937047d61616e (diff)
fix(headers) make enum explicitly use std::result::Result
Before it just used `Result` which can collide with custom result types.
-rw-r--r--headers/src/map/mod.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/headers/src/map/mod.rs b/headers/src/map/mod.rs
index 22de165..7718bd3 100644
--- a/headers/src/map/mod.rs
+++ b/headers/src/map/mod.rs
@@ -624,8 +624,7 @@ impl<'a, H> Debug for TypedBodiesMut<'a, H>
macro_rules! headers {
($($header:ty : $val:expr),*) => ({
//FIXME[rust/catch block] use catch block once available
- (|| -> Result<$crate::HeaderMap, $crate::error::ComponentCreationError>
- {
+ (|| -> ::std::result::Result<$crate::HeaderMap, $crate::error::ComponentCreationError> {
let mut map = $crate::HeaderMap::new();
$(
map.insert(<$header as $crate::HeaderKind>::auto_body($val)?);
@@ -1039,4 +1038,15 @@ mod test {
assert_eq!(3, map.len());
});
+
+ test!(does_not_conflic_with_custom_result_type {
+ #[allow(unused)]
+ type Result<T> = ::std::result::Result<T, ()>;
+
+ let map = headers! {
+ Subject: "yay"
+ }?;
+
+ assert_eq!(1, map.len());
+ });
} \ No newline at end of file