1. 16 8月, 2013 16 次提交
  2. 15 8月, 2013 17 次提交
  3. 14 8月, 2013 7 次提交
    • B
      auto merge of #8452 : Kimundi/rust/stuff02, r=bstrie · 927aff17
      bors 提交于
      - Methodyfied the string ascii extionsion functions - They got added recently, I wrapped them in a trait.
      - Added `into_owned()` method for vectors - similar to `Str`'s `into_owned()` function, allows to convert to a owned vector without making a copy if the source is a owned vector.
      - Added `or_some` method to option - similar to `unwrap_or_default`, but keeps the values wrapped in an `Option`. Useful for `Option` chains, eg Iterator impls.
      - Added `DoubleEndedIterator` impl to `Option` - Just for compatibility with generic Iterator functions.
      - Renamed nil.rs to unit.rs - the type got renamed ages ago, it's time the source file is as well.
      927aff17
    • H
      std: Move the iterator param on FromIterator and Extendable to the method. · 53487a02
      Huon Wilson 提交于
      If they are on the trait then it is extremely annoying to use them as
      generic parameters to a function, e.g. with the iterator param on the trait
      itself, if one was to pass an Extendable<int> to a function that filled it
      either from a Range or a Map<VecIterator>, one needs to write something
      like:
      
          fn foo<E: Extendable<int, Range<int>> +
                    Extendable<int, Map<&'self int, int, VecIterator<int>>>
                (e: &mut E, ...) { ... }
      
      since using a generic, i.e. `foo<E: Extendable<int, I>, I: Iterator<int>>`
      means that `foo` takes 2 type parameters, and the caller has to specify them
      (which doesn't work anyway, as they'll mismatch with the iterators used in
      `foo` itself).
      
      This patch changes it to:
      
          fn foo<E: Extendable<int>>(e: &mut E, ...) { ... }
      53487a02
    • H
      rustc: allow @ as-patterns to move when the sub-pattern contains no bindings. · 58021be4
      Huon Wilson 提交于
      A pattern like `foo @ Foo(Bar(*), _)` should be legal, even if `foo` moves,
      since the subpatterns are purely structural.
      
      Fixes #3761.
      58021be4
    • B
      auto merge of #8453 : dmanescu/rust/8451, r=cmr · 836a3d9b
      bors 提交于
      I'm not sure that the supplied tests are suitable.
      836a3d9b
    • M
      Methodyfied the string ascii extionsion functions · a00becd0
      Marvin Löbel 提交于
      Added into_owned() method for vectors
      Added DoubleEnded Iterator impl to Option
      Renamed nil.rs to unit.rs
      a00becd0
    • B
      auto merge of #8440 : sfackler/rust/env-fix, r=pcwalton · ac49e656
      bors 提交于
      The type of the result of option_env! was not fully specified in the
      None case, leading to type check failures in the case where the variable
      was not defined (e.g. option_env!("FOO").is_none()).
      
      Also cleaned up some compilation warnings.
      ac49e656
    • B
      auto merge of #8439 : huonw/rust/hashset-clone, r=cmr · cd656c74
      bors 提交于
      Closes #5581.
      cd656c74