Commit Graph

349 Commits

Author SHA1 Message Date
bluss 6ad4ca7a77 MAINT: Rust version Rust 1.15 2017-08-05 18:04:14 +02:00
bluss c5e0b80f73 FEAT: Turn try_remove/try_swap_remove into remove_opt and swap_pop
We turn these into "checked" removals, similar to `.pop()`. Name
swap_pop seems straightforward and nice, remove_opt is not as certain.
2017-08-05 17:52:24 +02:00
bluss bc9e0362bd FEAT: Remove InsertError again
try_insert has a capacity error, but panics if the index is out of
bounds.
2017-08-05 17:40:12 +02:00
bluss 7deb5c5db4 Merge pull request #47 from tbu-/pr_gitignore_cargolock
Ignore `Cargo.lock` in Git
2017-07-30 17:12:58 +02:00
bluss 1e83039426 FEAT: Align ArrayString .push and .push_str with String
Use same signatures (meaning: panics on errors). Add fallible versions
.try_push() and .try_push_str()
2017-07-30 15:38:42 +02:00
bluss 345dd33942 FEAT: Refactor errors. Insert is either out of bounds or capacity error 2017-07-30 15:12:03 +02:00
bluss 4d7887010e DOC: Update docs for debug assertions 2017-07-30 14:33:49 +02:00
bluss 707ddc3224 MAINT: Use serde-1 feature in docs.rs 2017-07-30 14:15:34 +02:00
bluss a59b5c0b86 DOC: Rust version in docs
Required rust version should be in rustdoc

Reason: Written in one or a few places. Information is versioned with
the crate on docs.rs
2017-07-30 14:14:25 +02:00
bluss 1d08021107 BUG: Fix serde code for push change 2017-07-30 14:12:24 +02:00
bluss 3a235d7206 FEAT: Test in Travis from Rust 1.18 2017-07-30 13:29:54 +02:00
bluss da62042001 FEAT: Make swap_remove return the element, add try_swap_remove for fallible 2017-07-30 13:18:50 +02:00
bluss 98af43cf9c FEAT: Make .push() use panics for errors, add .try_push() 2017-07-30 13:14:22 +02:00
bluss dadeedb787 FEAT: Proper Error impls for errors
Also use pub(crate), requiring Rust 1.18
2017-07-30 13:13:52 +02:00
bluss 79ccdcd910 FEAT: Copy RangeArgument from crate odds
This means odds is no longer a public dependency, which simplifies the
version story for arrayvec
2017-07-30 13:00:53 +02:00
bluss 5dcb5ab2c7 FEAT: Change .insert() and .remove() to match Vec
- Add try_insert / try_remove to be the old fallible variants that
  return errors
- Insert that pushes out if full does no longer exist -- full vec is an
  error
2017-07-30 12:57:28 +02:00
bluss 29497206da Merge pull request #55 from daboross/serde
Add serde support
2017-07-30 12:15:38 +02:00
bluss 600dc5c8b2 Merge pull request #53 from niklasf/push-unchecked
Factor out push_unchecked()
2017-07-30 12:07:15 +02:00
bluss 28b2543ae0 Remove failing test (with optimizations)
What the test was doing was simply UB and we can't expect rustc to make
sense of it. The test was failing with optimizations on, yet a closer look
says arrayvec is still working as it should. So remove the broken test.
2017-07-29 12:38:50 +02:00
bluss 2abdaf137e Add apache license file 2017-07-29 00:46:31 +02:00
David Ross 6cd03dce8d Add failure tests for serde implementations
Thanks to @camlorn for the idea.
2017-06-16 15:09:48 -07:00
David Ross 704f237282 Remove ambiguities in serde expecting messages. 2017-06-14 21:55:57 -07:00
David Ross d4bed04908 Add Array implementation for 50, 100 and 200
The implementation for 50 would be useful for a use case of mine, if that's alright. 100 and 200 are added for completeness to match 50 existing.
2017-06-14 21:52:38 -07:00
David Ross 1b0168bb6f Change feature name from 'serde' to 'serde-1'. 2017-06-08 12:02:21 -07:00
David Ross 21cd20ff26 Add 'serde' feature for serializing and deserializing ArrayVec and ArrayString.
This implements serde support under the optional 'serde' feature, and adds unit tests to test said support.
https://serde.rs/unit-testing.html used as a guide for the unit tests - using 'serde_test' makes for much
less boilerplate here, but it does require that the project have a non-optional dev dependency on 'serde_test'.
2017-06-08 01:42:34 -07:00
Niklas Fiekas 12eee0677c Debug assert capacity in push_unchecked() 2017-05-24 21:16:27 +02:00
Niklas Fiekas 1b6e0a3bfb Use push_unchecked() for Extend 2017-05-13 23:51:17 +02:00
Niklas Fiekas d0ebfcd51f Factor out push_unchecked() 2017-05-13 23:51:17 +02:00
bluss adf08656cc Merge pull request #51 from tbu-/pr_arraystring_ord
Add `PartialOrd` and `Ord` implementation to `ArrayString`
2017-04-22 18:27:44 +02:00
Tobias Bucher 0c8f46796e Add PartialOrd and Ord implementation to ArrayString
Fixes #50.
2017-04-22 16:31:41 +02:00
bluss d3c105563a Add 0.3 branch to .travis 2017-03-25 15:20:44 +01:00
bluss 7721eff0d3 Merge pull request #49 from bluss/next-1
Prepare for next major version (Part 1)
2017-03-24 18:41:23 +00:00
bluss f65ea92da4 Remove the optional generic-array feature
- It can be added back later if needed
- A public dependency implies version coupling, and we can't afford to
  have it for a niche use case.
2017-03-24 18:57:39 +01:00
bluss e6c090de88 New minimum Rust version 2017-03-24 18:50:57 +01:00
Tobias Bucher 49c69d440e Ignore Cargo.lock in Git
This is a library project and should not check in its `Cargo.lock`.
Being in the `.gitignore` file helps achieve that.

http://doc.crates.io/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries
2017-03-18 13:40:35 +01:00
bluss 738721a28d arrayvec 0.3.21 2017-03-17 18:50:36 +01:00
bluss 805f28f0d7 nodrop 0.1.9 2017-02-23 20:34:49 +01:00
bluss 5bbda855e1 Merge pull request #44 from bluss/next
Use u8 field in the NoDrop Dropped variant
2017-02-23 19:34:20 +00:00
bluss 34459766c2 Use u8 field in the NoDrop Dropped variant
We need to ensure NoDrop<&T> and similar are not using the enum layout
optimization. Using an enum { Alive(T), Dropped(u8) } is a simple way to
do that. The NoDrop (non-unions version) was already always at least
1 byte large anyway.
2017-02-23 20:19:11 +01:00
bluss da459bcf78 Add constructor ArrayString::from_byte_string(b"abc")
This is an alternative constructor that never has capacity errors.
Unfortunately the error case is invalid UTF-8!
2016-12-14 15:01:17 +01:00
bluss 3d69403dee Use encode_utf8 from crate odds 2016-10-16 11:54:44 +02:00
bluss d43c959fa8 0.3.20 2016-10-04 14:47:14 +02:00
bluss 7a7ec178b9 Fix ArrayString to implement .push(char) faster
Previously we used formatting, which is a virtual call and quite the
detour. Now copy the utf-8 encoding code from Rust (thank you Alex
Crichton) and use that.
2016-10-04 14:40:33 +02:00
bluss f331bb1228 0.3.19 2016-09-28 11:13:15 +02:00
bluss 3d2dcb4252 Merge pull request #41 from bluss/generic-array
Support generic-array as arrayvec backend
2016-09-28 11:10:32 +02:00
bluss 60a97632bc Support generic-array as arrayvec backend 2016-09-28 11:06:20 +02:00
bluss 82ab295554 0.3.18 2016-09-21 14:25:24 +02:00
bluss b1369460e3 Merge pull request #39 from bluss/insert
Fix bounds checking in ArrayVec::insert(index, element)
2016-09-21 14:25:17 +02:00
bluss 2a1378d3eb Fix bounds checking in ArrayVec::insert(index, element)
Must be `index <= len && index < capacity`
2016-09-21 14:21:07 +02:00
bluss d86f06b068 Change the doc generation script 2016-09-08 11:51:11 +02:00