1. 01 4月, 2014 2 次提交
  2. 30 3月, 2014 1 次提交
  3. 29 3月, 2014 1 次提交
  4. 28 3月, 2014 2 次提交
  5. 19 3月, 2014 2 次提交
  6. 13 3月, 2014 1 次提交
  7. 12 3月, 2014 1 次提交
    • Z
      Added convenience methods and accompanying tests to the Json class. · 9e0cfa23
      zslayton 提交于
      Fixed some styling issues with trailing whitespace.
      
      - Removed redundant functions.
      - Renamed `get` to `find`
      - Renamed `get_path` to `find_path`
      - Renamed `find` to `search`
      - Changed as_object and as_list to return Object and List
        rather than the underlying implementation types
        of TreeMap<~str,Json> and ~[Json]
      - Refactored find_path to use a fold() instead of recursion
      
      Formatting fixes.
      
      Fixed spacing, deleted comment.
      
      Added convenience methods and accompanying tests to the Json class.
      
      Updated tests to expect less pointer indirection.
      9e0cfa23
  8. 05 3月, 2014 2 次提交
  9. 01 3月, 2014 1 次提交
    • A
      std: Change assert_eq!() to use {} instead of {:?} · 02882fbd
      Alex Crichton 提交于
      Formatting via reflection has been a little questionable for some time now, and
      it's a little unfortunate that one of the standard macros will silently use
      reflection when you weren't expecting it. This adds small bits of code bloat to
      libraries, as well as not always being necessary. In light of this information,
      this commit switches assert_eq!() to using {} in the error message instead of
      {:?}.
      
      In updating existing code, there were a few error cases that I encountered:
      
      * It's impossible to define Show for [T, ..N]. I think DST will alleviate this
        because we can define Show for [T].
      * A few types here and there just needed a #[deriving(Show)]
      * Type parameters needed a Show bound, I often moved this to `assert!(a == b)`
      * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths.
        I don't think this is much of a regression though because {:?} on paths looks
        awful (it's a byte array).
      
      Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime
      significant for smaller binaries.
      02882fbd
  10. 25 2月, 2014 1 次提交
  11. 24 2月, 2014 1 次提交
    • A
      Remove all ToStr impls, add Show impls · b78b7498
      Alex Crichton 提交于
      This commit changes the ToStr trait to:
      
          impl<T: fmt::Show> ToStr for T {
              fn to_str(&self) -> ~str { format!("{}", *self) }
          }
      
      The ToStr trait has been on the chopping block for quite awhile now, and this is
      the final nail in its coffin. The trait and the corresponding method are not
      being removed as part of this commit, but rather any implementations of the
      `ToStr` trait are being forbidden because of the generic impl. The new way to
      get the `to_str()` method to work is to implement `fmt::Show`.
      
      Formatting into a `&mut Writer` (as `format!` does) is much more efficient than
      `ToStr` when building up large strings. The `ToStr` trait forces many
      intermediate allocations to be made while the `fmt::Show` trait allows
      incremental buildup in the same heap allocated buffer. Additionally, the
      `fmt::Show` trait is much more extensible in terms of interoperation with other
      `Writer` instances and in more situations. By design the `ToStr` trait requires
      at least one allocation whereas the `fmt::Show` trait does not require any
      allocations.
      
      Closes #8242
      Closes #9806
      b78b7498
  12. 23 2月, 2014 1 次提交
    • A
      Move std::{trie, hashmap} to libcollections · 2a14e084
      Alex Crichton 提交于
      These two containers are indeed collections, so their place is in
      libcollections, not in libstd. There will always be a hash map as part of the
      standard distribution of Rust, but by moving it out of the standard library it
      makes libstd that much more portable to more platforms and environments.
      
      This conveniently also removes the stuttering of 'std::hashmap::HashMap',
      although 'collections::HashMap' is only one character shorter.
      2a14e084
  13. 21 2月, 2014 1 次提交
    • A
      Mass rename if_ok! to try! · 7bb498bd
      Alex Crichton 提交于
      This "bubble up an error" macro was originally named if_ok! in order to get it
      landed, but after the fact it was discovered that this name is not exactly
      desirable.
      
      The name `if_ok!` isn't immediately clear that is has much to do with error
      handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In
      general, the agreed opinion about `if_ok!` is that is came in as subpar.
      
      The name `try!` is more invocative of error handling, it's shorter by 2 letters,
      and it looks fitting in almost all circumstances. One concern about the word
      `try!` is that it's too invocative of exceptions, but the belief is that this
      will be overcome with documentation and examples.
      
      Close #12037
      7bb498bd
  14. 19 2月, 2014 1 次提交
  15. 18 2月, 2014 1 次提交
  16. 15 2月, 2014 2 次提交
  17. 08 2月, 2014 1 次提交
  18. 07 2月, 2014 1 次提交
  19. 06 2月, 2014 1 次提交
    • J
      pull extra::{serialize, ebml} into a separate libserialize crate · b8852e89
      Jeff Olson 提交于
      - `extra::json` didn't make the cut, because of `extra::json` required
         dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`,
         then `extra::json` could move into `serialize`
      - `libextra`, `libsyntax` and `librustc` depend on the newly created
        `libserialize`
      - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap`
        and `TreeSet` for `Encodable`/`Decodable` were moved into the respective
        modules in `extra`
      - There is some trickery, evident in `src/libextra/lib.rs` where a stub
        of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for
        use in the stage0 build, where the snapshot rustc is still making
        deriving for `Encodable` and `Decodable` point at extra. Big props to
        @huonw for help working out the re-export solution for this
      
      extra: inline extra::serialize stub
      
      fix stuff clobbered in rebase + don't reexport serialize::serialize
      
      no more globs in libserialize
      
      syntax: fix import of libserialize traits
      
      librustc: fix bad imports in encoder/decoder
      
      add serialize dep to librustdoc
      
      fix failing run-pass tests w/ serialize dep
      
      adjust uuid dep
      
      more rebase de-clobbering for libserialize
      
      fixing tests, pushing libextra dep into cfg(test)
      
      fix doc code in extra::json
      
      adjust index.md links to serialize and uuid library
      b8852e89
  20. 04 2月, 2014 1 次提交
  21. 30 1月, 2014 1 次提交
    • B
      Remove Times trait · 729060db
      Brendan Zabarauskas 提交于
      `Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal was then lost after `do` was disabled for closures. It's time to let this one go.
      729060db
  22. 29 1月, 2014 1 次提交
  23. 22 1月, 2014 2 次提交
  24. 21 1月, 2014 1 次提交
  25. 19 1月, 2014 4 次提交
    • M
      extra::json: add documentation and examples · aeb54167
      musitdev 提交于
      aeb54167
    • M
      extra::json: add documentation and examples · 339946cf
      musitdev 提交于
      339946cf
    • M
      Squashed commit of the following: · 1a8a901f
      musitdev 提交于
      commit d00623d60afd460755b749ad5f94935f756f29d2
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Sat Jan 4 22:31:40 2014 +0100
      
          correct last comments.
      
      commit ef09d6b6d1eebbd7c713c9dad96ed7bfc19dd884
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Thu Jan 2 20:28:53 2014 +0100
      
          update with the last remarks.
      
      commit 46a028fe1fcdc2a7dcdd78a63001793eff614349
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Thu Jan 2 10:17:18 2014 +0100
      
          wrap example code in main function.
      
      commit 2472901929bef09786b7aef8ca7c89fbe67d8e3e
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Mon Dec 30 19:32:46 2013 +0100
      
          Correct code to compile.
      
      commit ed96b2223176781743e984af0e19abcb82150f1f
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Thu Dec 5 11:32:28 2013 +0100
      
          Correct the comment based on the PR comment.
          Change init call to new to reflect last change.
      
      commit 38b0390c3533a16f822a6df5f90b907bd8ed6edc
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Wed Dec 4 22:34:25 2013 +0100
      
          correct from_utf8_owned call.
      
      commit 08bed4c5f4fadf93ec457b605a1a1354323d2f5c
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Wed Dec 4 22:12:41 2013 +0100
      
          correct code '''
      
      commit 02fddcbe2ab37fe842872691105bc4c5cff5abb5
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Wed Dec 4 13:25:54 2013 +0100
      
          correct typing error
      
      commit b26830b8ddb49f551699e791832ed20640a0fafc
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Wed Dec 4 13:18:39 2013 +0100
      
          pass make check
      
      commit e87c4f53286122efd0d2364ea45600d4fa4d5744
      Author: musitdev <philippe.delrieu@free.fr>
      Date:   Wed Dec 4 10:47:24 2013 +0100
      
          Add Json example and documentation.
      1a8a901f
    • F
      Replace old pow_with_uint with the new pow func · 3830a3b4
      Flavio Percoco 提交于
      There was an old and barely used implementation of pow, which expected
      both parameters to be uint and required more traits to be implemented.
      Since a new implementation for `pow` landed, I'm proposing to remove
      this old impl in favor of the new one.
      
      The benchmark shows that the new implementation is faster than the one
      being removed:
      
      test num::bench::bench_pow_function               ..bench:      9429 ns/iter (+/- 2055)
      test num::bench::bench_pow_with_uint_function     ...bench:     28476 ns/iter (+/- 2202)
      3830a3b4
  26. 18 1月, 2014 1 次提交
    • A
      Tweak the interface of std::io · 295b46fc
      Alex Crichton 提交于
      * Reexport io::mem and io::buffered structs directly under io, make mem/buffered
        private modules
      * Remove with_mem_writer
      * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)
      295b46fc
  27. 09 1月, 2014 1 次提交
    • A
      Remove the io::Decorator trait · 6df57ec2
      Alex Crichton 提交于
      This is just an unnecessary trait that no one's ever going to parameterize over
      and it's more useful to just define the methods directly on the types
      themselves. The implementors of this type almost always don't want
      inner_mut_ref() but they're forced to define it as well.
      6df57ec2
  28. 08 1月, 2014 1 次提交
  29. 12 12月, 2013 1 次提交
  30. 05 12月, 2013 1 次提交
  31. 30 11月, 2013 1 次提交