Skip to content

Commit

Permalink
refactor(header): change name of deref! to __hyper__deref!
Browse files Browse the repository at this point in the history
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!.
  • Loading branch information
seanmonstar committed May 12, 2015
1 parent f64fb10 commit 62d96ad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/header/common/cache_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use header::parsing::{from_one_comma_delimited, fmt_comma_delimited};
#[derive(PartialEq, Clone, Debug)]
pub struct CacheControl(pub Vec<CacheDirective>);

deref!(CacheControl => Vec<CacheDirective>);
__hyper__deref!(CacheControl => Vec<CacheDirective>);

impl Header for CacheControl {
fn header_name() -> &'static str {
Expand Down
2 changes: 1 addition & 1 deletion src/header/common/cookie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use cookie::CookieJar;
#[derive(Clone, PartialEq, Debug)]
pub struct Cookie(pub Vec<CookiePair>);

deref!(Cookie => Vec<CookiePair>);
__hyper__deref!(Cookie => Vec<CookiePair>);

impl Header for Cookie {
fn header_name() -> &'static str {
Expand Down
10 changes: 5 additions & 5 deletions src/header/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ macro_rules! bench_header(
);

#[macro_export]
macro_rules! deref(
macro_rules! __hyper__deref {
($from:ty => $to:ty) => {
impl ::std::ops::Deref for $from {
type Target = $to;
Expand All @@ -96,7 +96,7 @@ macro_rules! deref(
}
}
}
);
}

#[macro_export]
macro_rules! __hyper__tm {
Expand Down Expand Up @@ -166,7 +166,7 @@ macro_rules! header {
$(#[$a])*
#[derive(Clone, Debug, PartialEq)]
pub struct $id(pub Vec<$item>);
deref!($id => Vec<$item>);
__hyper__deref!($id => Vec<$item>);
impl $crate::header::Header for $id {
fn header_name() -> &'static str {
$n
Expand All @@ -192,7 +192,7 @@ macro_rules! header {
$(#[$a])*
#[derive(Clone, Debug, PartialEq)]
pub struct $id(pub Vec<$item>);
deref!($id => Vec<$item>);
__hyper__deref!($id => Vec<$item>);
impl $crate::header::Header for $id {
fn header_name() -> &'static str {
$n
Expand All @@ -218,7 +218,7 @@ macro_rules! header {
$(#[$a])*
#[derive(Clone, Debug, PartialEq)]
pub struct $id(pub $value);
deref!($id => $value);
__hyper__deref!($id => $value);
impl $crate::header::Header for $id {
fn header_name() -> &'static str {
$n
Expand Down
2 changes: 1 addition & 1 deletion src/header/common/set_cookie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use cookie::CookieJar;
#[derive(Clone, PartialEq, Debug)]
pub struct SetCookie(pub Vec<Cookie>);

deref!(SetCookie => Vec<Cookie>);
__hyper__deref!(SetCookie => Vec<Cookie>);

impl Header for SetCookie {
fn header_name() -> &'static str {
Expand Down

0 comments on commit 62d96ad

Please sign in to comment.