Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e05c2f8
trans: Add early-out when translating unreachable controlflow express…
michaelwoerister Mar 5, 2015
45c10db
Clarified and simplified algorithm for increasing size of buffer in
Mar 29, 2015
2982fe3
80 character line limit
Mar 29, 2015
8d3e559
Clearer wording
Mar 29, 2015
240734c
Only zero at most 64k at a time. We still use the doubling
Mar 30, 2015
0939837
Rename the cryptic cres and ures types.
nikomatsakis Mar 9, 2015
4b0edb9
Combine `try` and `commit_if_ok` and make some details of inference
nikomatsakis Mar 10, 2015
7c62640
Refactor unification interface by moving the methods off of inferctxt…
nikomatsakis Feb 15, 2015
c581840
Make union-find helper fns private, change to u32.
nikomatsakis Feb 16, 2015
a6d9930
Extract more `ty` and `infer` dependencies from the unification engine
nikomatsakis Mar 10, 2015
e78550b
Switch to FnvHashMap
nikomatsakis Mar 18, 2015
e301d7c
Remove unused import
nikomatsakis Mar 18, 2015
8403b82
Port over type inference to using the new type relation stuff
nikomatsakis Mar 22, 2015
cead47c
Add a "match" relation that can be used to make recursion check during
nikomatsakis Mar 20, 2015
cdb10b8
A very simple hack to force an autoderef if the callee has type `&mut
nikomatsakis Mar 31, 2015
27b7841
Add blanket impls for references to the `Fn` traits.
nikomatsakis Mar 20, 2015
11111bb
Add tests for blanket impls.
nikomatsakis Mar 31, 2015
a547962
Pretty print ids for assoc items
nrc Mar 24, 2015
bfc2f5d
Improvements to PhantomData<T>'s docs 👻
steveklabnik Apr 1, 2015
0dd0925
Tidying up and reformatting
nrc Mar 29, 2015
39aa668
Added Arc::try_unique
kvark Mar 29, 2015
8ded156
Add examples + documentation for std::path
steveklabnik Apr 1, 2015
4b6248a
Simplify `match` branches in iter.rs example
frewsxcv Apr 1, 2015
03d3ba7
Implement the changes to coherence such that we consider a type to be
nikomatsakis Mar 30, 2015
35c261a
Add `#[fundamental]` annotations into libcore so that `Sized` and the
nikomatsakis Mar 30, 2015
b0af587
Update tests for new coherence rules, and add a swatch of new tests
nikomatsakis Mar 30, 2015
30b2d9e
Fallout in libstd: remove impls now considered to conflict.
nikomatsakis Mar 30, 2015
15b58fe
Fallout in libsyntax/librustc: use newtype'd options for linked lists,
nikomatsakis Mar 30, 2015
02b38a2
Rollup merge of #23066 - michaelwoerister:unreachable-if, r=pnkfelix
Manishearth Apr 1, 2015
1d17e6e
Rollup merge of #23844 - kvark:try_unique, r=alexcrichton
Manishearth Apr 1, 2015
abd747c
Rollup merge of #23847 - bcoopers:read_clarification, r=sfackler
Manishearth Apr 1, 2015
9eb0bab
Rollup merge of #23867 - nikomatsakis:issue-23086-take-3, r=pnkfelix
Manishearth Apr 1, 2015
debac97
Rollup merge of #23895 - nikomatsakis:fn-trait-inheritance-add-impls,…
Manishearth Apr 1, 2015
6a3e844
Rollup merge of #23924 - nrc:unqual-assoc3, r=alexcrichton
Manishearth Apr 1, 2015
2159bbf
Rollup merge of #23925 - steveklabnik:gh22914, r=Gankro
Manishearth Apr 1, 2015
77112bb
Rollup merge of #23927 - frewsxcv:patch-7, r=Manishearth
Manishearth Apr 1, 2015
ec6c2c3
Rollup merge of #23932 - steveklabnik:doc_std_path, r=flaper87
Manishearth Apr 1, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only zero at most 64k at a time. We still use the doubling
reallocation strategy since extend() calls reserve() and/or
push() for us.
  • Loading branch information
bcoopers committed Mar 30, 2015
commit 240734c31e529557583a0dc8e97abf858b4a375d
12 changes: 4 additions & 8 deletions src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,14 @@ fn append_to_string<F>(buf: &mut String, f: F) -> Result<usize>
fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize> {
let start_len = buf.len();
let mut len = start_len;
let min_cap_bump = 16;
let mut new_write_size = 16;
let ret;
loop {
if len == buf.len() {
if buf.capacity() == buf.len() {
// reserve() rounds up our request such that every request
// (with maybe the exception of the first request) for the
// same amount of space doubles our capacity.
buf.reserve(min_cap_bump);
if new_write_size < DEFAULT_BUF_SIZE {
new_write_size *= 2;
}
let new_area = buf.capacity() - buf.len();
buf.extend(iter::repeat(0).take(new_area));
buf.extend(iter::repeat(0).take(new_write_size));
}

match r.read(&mut buf[len..]) {
Expand Down