refactor(header): change name of deref! to __hyper__deref!

The header is largely for internal use, however, it must be exported
because the header! macro uses it. As deref! is also a particularly
general name, this renames it to __hyper__deref! to prevent name
clashes.

BREAKING CHANGE: If you use deref! from the header module, you'll need
  to switch to using __hyper__deref!.
This commit is contained in:
Sean McArthur
2015-05-11 19:00:38 -07:00
parent f64fb10bc8
commit 62d96adc6b
4 changed files with 8 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ use header::parsing::{from_one_comma_delimited, fmt_comma_delimited};
#[derive(PartialEq, Clone, Debug)] #[derive(PartialEq, Clone, Debug)]
pub struct CacheControl(pub Vec<CacheDirective>); pub struct CacheControl(pub Vec<CacheDirective>);
deref!(CacheControl => Vec<CacheDirective>); __hyper__deref!(CacheControl => Vec<CacheDirective>);
impl Header for CacheControl { impl Header for CacheControl {
fn header_name() -> &'static str { fn header_name() -> &'static str {

View File

@@ -20,7 +20,7 @@ use cookie::CookieJar;
#[derive(Clone, PartialEq, Debug)] #[derive(Clone, PartialEq, Debug)]
pub struct Cookie(pub Vec<CookiePair>); pub struct Cookie(pub Vec<CookiePair>);
deref!(Cookie => Vec<CookiePair>); __hyper__deref!(Cookie => Vec<CookiePair>);
impl Header for Cookie { impl Header for Cookie {
fn header_name() -> &'static str { fn header_name() -> &'static str {

View File

@@ -80,7 +80,7 @@ macro_rules! bench_header(
); );
#[macro_export] #[macro_export]
macro_rules! deref( macro_rules! __hyper__deref {
($from:ty => $to:ty) => { ($from:ty => $to:ty) => {
impl ::std::ops::Deref for $from { impl ::std::ops::Deref for $from {
type Target = $to; type Target = $to;
@@ -96,7 +96,7 @@ macro_rules! deref(
} }
} }
} }
); }
#[macro_export] #[macro_export]
macro_rules! __hyper__tm { macro_rules! __hyper__tm {
@@ -166,7 +166,7 @@ macro_rules! header {
$(#[$a])* $(#[$a])*
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct $id(pub Vec<$item>); pub struct $id(pub Vec<$item>);
deref!($id => Vec<$item>); __hyper__deref!($id => Vec<$item>);
impl $crate::header::Header for $id { impl $crate::header::Header for $id {
fn header_name() -> &'static str { fn header_name() -> &'static str {
$n $n
@@ -192,7 +192,7 @@ macro_rules! header {
$(#[$a])* $(#[$a])*
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct $id(pub Vec<$item>); pub struct $id(pub Vec<$item>);
deref!($id => Vec<$item>); __hyper__deref!($id => Vec<$item>);
impl $crate::header::Header for $id { impl $crate::header::Header for $id {
fn header_name() -> &'static str { fn header_name() -> &'static str {
$n $n
@@ -218,7 +218,7 @@ macro_rules! header {
$(#[$a])* $(#[$a])*
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct $id(pub $value); pub struct $id(pub $value);
deref!($id => $value); __hyper__deref!($id => $value);
impl $crate::header::Header for $id { impl $crate::header::Header for $id {
fn header_name() -> &'static str { fn header_name() -> &'static str {
$n $n

View File

@@ -57,7 +57,7 @@ use cookie::CookieJar;
#[derive(Clone, PartialEq, Debug)] #[derive(Clone, PartialEq, Debug)]
pub struct SetCookie(pub Vec<Cookie>); pub struct SetCookie(pub Vec<Cookie>);
deref!(SetCookie => Vec<Cookie>); __hyper__deref!(SetCookie => Vec<Cookie>);
impl Header for SetCookie { impl Header for SetCookie {
fn header_name() -> &'static str { fn header_name() -> &'static str {