Explorar el Código

Remove lifetimes

Daniel Lockyer hace 9 años
padre
commit
01ec217a82
Se han modificado 3 ficheros con 6 adiciones y 6 borrados
  1. 1 1
      src/form_urlencoded.rs
  2. 4 4
      src/parser.rs
  3. 1 1
      src/percent_encoding.rs

+ 1 - 1
src/form_urlencoded.rs

@@ -121,7 +121,7 @@ fn decode(input: &[u8], encoding: EncodingOverride) -> Cow<str> {
 }
 
 /// Replace b'+' with b' '
-fn replace_plus<'a>(input: &'a [u8]) -> Cow<'a, [u8]> {
+fn replace_plus(input: &[u8]) -> Cow<[u8]> {
     match input.iter().position(|&b| b == b'+') {
         None => Cow::Borrowed(input),
         Some(first_position) => {

+ 4 - 4
src/parser.rs

@@ -736,8 +736,8 @@ impl<'a> Parser<'a> {
         Ok((host_end, host.into(), port, remaining))
     }
 
-    pub fn parse_host<'i>(mut input: Input<'i>, scheme_type: SchemeType)
-                             -> ParseResult<(Host<String>, Input<'i>)> {
+    pub fn parse_host(mut input: Input, scheme_type: SchemeType)
+                             -> ParseResult<(Host<String>, Input)> {
         // Undo the Input abstraction here to avoid allocating in the common case
         // where the host part of the input does not contain any tab or newline
         let input_str = input.chars.as_str();
@@ -830,9 +830,9 @@ impl<'a> Parser<'a> {
         Ok((true, host, remaining))
     }
 
-    pub fn parse_port<'i, P>(mut input: Input<'i>, default_port: P,
+    pub fn parse_port<P>(mut input: Input, default_port: P,
                                 context: Context)
-                                -> ParseResult<(Option<u16>, Input<'i>)>
+                                -> ParseResult<(Option<u16>, Input)>
                                 where P: Fn() -> Option<u16> {
         let mut port: u32 = 0;
         let mut has_any_digit = false;

+ 1 - 1
src/percent_encoding.rs

@@ -242,7 +242,7 @@ impl<'a, E: EncodeSet> From<PercentEncode<'a, E>> for Cow<'a, str> {
 /// (which returns `Cow::Borrowed` when `input` contains no percent-encoded sequence)
 /// and has `decode_utf8()` and `decode_utf8_lossy()` methods.
 #[inline]
-pub fn percent_decode<'a>(input: &'a [u8]) -> PercentDecode<'a> {
+pub fn percent_decode(input: &[u8]) -> PercentDecode {
     PercentDecode {
         bytes: input.iter()
     }