diff options
Diffstat (limited to 'components/net_traits/request.rs')
-rw-r--r-- | components/net_traits/request.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/components/net_traits/request.rs b/components/net_traits/request.rs index 795a8556f6f..3c780a2c5d5 100644 --- a/components/net_traits/request.rs +++ b/components/net_traits/request.rs @@ -9,7 +9,6 @@ use msg::constellation_msg::PipelineId; use servo_url::ServoUrl; use std::cell::{Cell, RefCell}; use std::default::Default; -use std::mem::swap; use url::{Origin as UrlOrigin}; /// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator) @@ -308,19 +307,4 @@ impl Referrer { Referrer::ReferrerUrl(ref url) => Some(url) } } - pub fn from_url(url: Option<ServoUrl>) -> Self { - if let Some(url) = url { - Referrer::ReferrerUrl(url) - } else { - Referrer::NoReferrer - } - } - pub fn take(&mut self) -> Option<ServoUrl> { - let mut new = Referrer::Client; - swap(self, &mut new); - match new { - Referrer::NoReferrer | Referrer::Client => None, - Referrer::ReferrerUrl(url) => Some(url) - } - } } |