637 Commits

Author SHA1 Message Date
Felix Stegmaier
40133fea0f Merge remote-tracking branch 'origin/master' into const-fn-feature 2018-07-13 11:25:56 +02:00
bors[bot]
f51e6252ef Merge #46
46: drop the nonzero feature gate r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-07-13 05:29:40 +00:00
Jorge Aparicio
e3c9f23e94 drop the nonzero feature gate 2018-07-13 00:29:08 -05:00
bors[bot]
d2beff0cef Merge #45
45: Fix incorrect length calculation for RingBuffer when head > tail r=japaric a=ReeceStevens

When the head index becomes greater than the tail, the `len()` function returns the incorrect length. This causes iterations over ring buffers to stop early as well, since they use the same calculation.

This PR adds two (very minimal) tests that demonstrate the error.

Co-authored-by: Reece Stevens <reecestevens24@gmail.com>
2018-07-13 04:56:38 +00:00
bors[bot]
f7265774ef Merge #44
44: Added Consumer::ready and Producer::ready indicating if it is ready t… r=japaric a=Frans-Willem

…o enqueue/dequeue.

I needed this to use it with a serial library. e.g. without it:
```
if let Some(x) = serial.read() {
if let Err(x) = producer.enqueue(x) {
// Now what ?
}
}
```
With the ready flag:
```
if producer.ready() {
if let Some(x) = serial.read() {
producer.enqueue(x).unwrap();
}
}
```

Co-authored-by: Frans-Willem Hardijzer <fw@hardijzer.nl>
2018-07-13 04:53:36 +00:00
Reece Stevens
84ce6ec159 Perform same len fix for iterators 2018-06-19 23:29:14 -05:00
Reece Stevens
0172082262 Fix len miscalculation when head > tail 2018-06-19 23:21:14 -05:00
Frans-Willem Hardijzer
34def0f98f Added Consumer::ready and Producer::ready indicating if it is ready to enqueue/dequeue. 2018-06-10 15:05:01 +02:00
Felix Stegmaier
c7bac27100 Enable ci tests with --all-features 2018-05-21 21:27:53 +02:00
Felix Stegmaier
123f489ad6 Add tests for static new methods 2018-05-21 21:19:50 +02:00
Felix Stegmaier
e48b15474d Update docs and tests 2018-05-21 13:18:28 +02:00
Felix Stegmaier
479c74d9e5 Fix static variables in tests 2018-05-19 18:32:47 +02:00
Felix Stegmaier
512ce719ed Fix missing_docs in const_fn macro 2018-05-19 12:25:30 +02:00
Felix
23b301362b WIP const_fn macro 2018-05-19 01:23:10 +02:00
bors[bot]
6ec77ef514 Merge #39
39: Implement FromIterator for Vec r=japaric a=XOSplicer

As discussed in #36 

Panics when the vector can not hold all values supplied by the iterator.
Calling `unwrap` on the result might not be the best choice here.
It might be better to match the result and have a custom panic message.
Is this the best possible behavior?

Co-authored-by: Felix <stegmaier.felix@gmail.com>
Co-authored-by: Felix Stegmaier <stegmaier.felix@gmail.com>
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-05-14 16:57:11 +00:00
Jorge Aparicio
a4d4d24d46
restore #[test] that got lost in the rebase 2018-05-14 18:56:42 +02:00
Jorge Aparicio
65ce6a6161
expect -> ok().expect 2018-05-14 18:50:27 +02:00
Jorge Aparicio
27ee3f8d7d
Merge branch 'master' into vec-fromiter 2018-05-14 18:39:48 +02:00
Jorge Aparicio
3c0daf9f03
rewrite match as expect 2018-05-14 18:37:38 +02:00
bors[bot]
495cace695 Merge #38
38: Implement IntoIter for Vec r=japaric a=XOSplicer

~~This implementation uses vec::reverse and vec::pop to move the content of the vector out of it.~~

It might give more performance to avoid the `reverse` and read each element individually. In the end  the unmoved items need to be dropped.



Co-authored-by: Felix <stegmaier.felix@gmail.com>
Co-authored-by: Felix Stegmaier <stegmaier.felix@gmail.com>
2018-05-14 16:32:21 +00:00
Felix Stegmaier
fe2650423e Rewrite Vec::IntoIter to avoid reversing it 2018-05-08 17:21:08 +02:00
Felix Stegmaier
53c10049aa Change Vec::from_iter to custom panic 2018-05-07 01:28:20 +02:00
Felix
c78441654f Implement FromIterator for Vec 2018-05-06 22:57:19 +02:00
Felix
fd5f4f0b3d Implement IntoIter using vec::reverse and vec::pop 2018-05-05 17:34:16 +02:00
Jorge Aparicio
e7ada67057 v0.3.6 v0.3.6 2018-05-04 10:18:17 +02:00
bors[bot]
93db77df6a Merge #37
37: fix capacity to be N+1 instead of 2*N+1 r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-05-04 08:08:23 +00:00
Jorge Aparicio
747afb5fbb fix capacity to be N+1 instead of 2*N+1 2018-05-04 10:07:49 +02:00
Jorge Aparicio
2e86db4b1e v0.3.5 v0.3.5 2018-05-03 05:45:17 +02:00
bors[bot]
1ea0389486 Merge #35
35: add RingBuffer.enqueue_unchecked r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-05-03 02:53:18 +00:00
Jorge Aparicio
7cd54a2ec2 add RingBuffer.enqueue_unchecked 2018-05-03 04:52:43 +02:00
Jorge Aparicio
ffc7849f27 avoid using NLL 2018-05-03 03:35:46 +02:00
Jorge Aparicio
1f2228e1cf v0.3.4 v0.3.4 2018-04-28 12:28:57 +02:00
bors[bot]
6419bc2386 Merge #34
34: add BinaryHeap.pop_unchecked r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-04-28 05:42:19 +00:00
Jorge Aparicio
af5d6d1480 add BinaryHeap.pop_unchecked 2018-04-28 07:40:48 +02:00
Jorge Aparicio
8121700a76 Hole: switch from Option to ManuallyDrop to avoid a panicking branch 2018-04-28 07:40:35 +02:00
Jorge Aparicio
08c76f34c7 v0.3.3 v0.3.3 2018-04-28 05:55:01 +02:00
bors[bot]
7836224ed9 Merge #33
33: add BinaryHeap.push_unchecked r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-04-28 03:49:40 +00:00
Jorge Aparicio
22ef801d6a cargo fmt 2018-04-28 05:49:05 +02:00
Jorge Aparicio
a58995eafb add BinaryHeap.push_unchecked 2018-04-28 05:48:58 +02:00
Jorge Aparicio
05633f9b56 elide a bounds check 2018-04-28 05:45:35 +02:00
bors[bot]
77b16efb0b Merge #32
32: re-export generic_array::ArrayLength r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
v0.3.2
2018-04-27 02:53:34 +00:00
Jorge Aparicio
66585909ef re-export generic_array::ArrayLength 2018-04-27 04:53:05 +02:00
Jorge Aparicio
38c4a8f66b omit thumb targets when building docs v0.3.1 2018-04-23 20:34:47 +02:00
Jorge Aparicio
ff6e1e7819 fix OR 2018-04-23 20:31:51 +02:00
bors[bot]
bbc18a24f3 Merge #31
31: add more functionality to Vec r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-04-23 18:25:27 +00:00
Jorge Aparicio
e8ef25eee1 add more functionality to Vec 2018-04-23 20:24:53 +02:00
bors[bot]
579cbcdf4c Merge #30
30: generate docs r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-04-23 17:55:17 +00:00
Jorge Aparicio
b0f155c6fd generate docs 2018-04-23 19:54:46 +02:00
bors[bot]
c5b2d11878 Merge #29
29: port IndexMap and IndexSet r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-04-23 17:45:21 +00:00
Jorge Aparicio
f60ae0d3e0 add example to IndexMap.remove 2018-04-23 19:43:57 +02:00