-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from contain-rs/new-features
Add more features: allocator-api2, no_std and (de)serialization
- Loading branch information
Showing
9 changed files
with
703 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
run: cargo build --verbose | ||
- run: cargo test --verbose | ||
- run: cargo test --features serde --verbose | ||
- run: cargo test --features miniserde --verbose | ||
- run: cargo test --features nanoserde --verbose | ||
- run: cargo test --features borsh --verbose | ||
- run: cargo test --no-default-features --verbose | ||
- run: cargo test --no-default-features --features serde_no_std --verbose | ||
|
||
miri: | ||
name: "Miri" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Miri | ||
run: | | ||
rustup toolchain install nightly --component miri | ||
rustup override set nightly | ||
cargo miri setup | ||
- name: Test with Miri | ||
run: MIRIFLAGS=-Zmiri-strict-provenance cargo miri test | ||
|
||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
- run: cargo fmt --all -- --check | ||
|
||
|
||
clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
- run: cargo clippy --workspace --tests --examples | ||
|
||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTDOCFLAGS: -Dwarnings | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
- uses: swatinem/rust-cache@v2 | ||
- run: cargo doc --workspace --no-deps | ||
|
||
msrv: | ||
name: Rust ${{matrix.rust}} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust: [1.67.0, 1.68.0] | ||
timeout-minutes: 45 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{matrix.rust}} | ||
- run: cargo test --verbose | ||
- run: cargo test --features serde --verbose | ||
- run: cargo test --features miniserde --verbose | ||
- run: cargo test --features nanoserde --verbose | ||
- run: cargo test --features borsh --verbose | ||
- run: cargo test --no-default-features --verbose | ||
- run: cargo test --no-default-features --features serde_no_std --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
target | ||
Cargo.lock | ||
/target | ||
/Cargo.lock |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"rust-analyzer.cargo.features": ["serde", "miniserde", "nanoserde", "borsh"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,40 @@ | |
|
||
name = "linked-list" | ||
version = "0.0.3" | ||
license = "MIT/Apache-2.0" | ||
license = "MIT OR Apache-2.0" | ||
description = "An alternative implementation of std::collections::LinkedList" | ||
|
||
authors = [ | ||
"Alexis Beingessner <[email protected]>", | ||
"Peter Blackson <[email protected]>", | ||
] | ||
|
||
edition = "2021" | ||
rust-version = "1.67" | ||
|
||
repository = "https://github.com/contain-rs/linked-list" | ||
homepage = "https://github.com/contain-rs/linked-list" | ||
documentation = "https://contain-rs.github.io/linked-list/linked_list" | ||
documentation = "https://docs.rs/linked-list/latest/linked_list" | ||
keywords = ["data-structures"] | ||
readme = "README.md" | ||
|
||
[dependencies] | ||
allocator-api2 = "0.2.20" | ||
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true } | ||
borsh = { version = "1.5", default-features = false, features = ["derive", "std"], optional = true } | ||
miniserde = { version = "0.1", optional = true } | ||
nanoserde = { version = "0.1", optional = true } | ||
|
||
[dev-dependencies] | ||
serde_json = "1.0" | ||
|
||
[features] | ||
nightly = [] | ||
default = ["std"] | ||
std = [] | ||
|
||
serde_std = ["std", "serde/std"] | ||
serde_no_std = ["serde/alloc"] | ||
borsh = ["dep:borsh", "std"] | ||
|
||
[package.metadata.docs.rs] | ||
features = ["serde", "miniserde", "nanoserde", "borsh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,66 @@ | ||
An alternative implementation of `std::collections::LinkedList` featuring a prototype Cursor. | ||
<div align="center"> | ||
<h1>linked-list</h1> | ||
<p> | ||
<strong>A simple linked list.</strong> | ||
</p> | ||
<p> | ||
|
||
Documentation is available at https://contain-rs.github.io/linked-list/linked_list. | ||
[![crates.io][crates.io shield]][crates.io link] | ||
[![Documentation][docs.rs badge]][docs.rs link] | ||
![Rust CI][github ci badge] | ||
![Minimum Supported Rustc Version][rustc 1.67+] | ||
<br /> | ||
<br /> | ||
[![Dependency Status][deps.rs status]][deps.rs link] | ||
[![Download Status][shields.io download count]][crates.io link] | ||
|
||
</p> | ||
</div> | ||
|
||
[crates.io shield]: https://img.shields.io/crates/v/linked-list?label=latest | ||
[crates.io link]: https://crates.io/crates/linked-list | ||
[docs.rs badge]: https://docs.rs/linked-list/badge.svg?version=0.0.3 | ||
[docs.rs link]: https://docs.rs/linked-list/0.0.3/linked_list/ | ||
[github ci badge]: https://github.com/contain-rs/linked-list/workflows/Rust/badge.svg?branch=master | ||
[rustc 1.67+]: https://img.shields.io/badge/rustc-1.67%2B-blue.svg | ||
[deps.rs status]: https://deps.rs/crate/linked-list/0.0.3/status.svg | ||
[deps.rs link]: https://deps.rs/crate/linked-list/0.0.3 | ||
[shields.io download count]: https://img.shields.io/crates/d/linked-list.svg | ||
|
||
## Usage | ||
|
||
Add this to your Cargo.toml: | ||
|
||
```toml | ||
[dependencies] | ||
linked-list = "0.0.3" | ||
``` | ||
|
||
Since Rust 2018, `extern crate` is no longer mandatory. If your edition is old (Rust 2015), | ||
add this to your crate root: | ||
|
||
```rust | ||
extern crate linked_list; | ||
``` | ||
|
||
If you want [serde](https://github.com/serde-rs/serde) support, include the feature like this: | ||
|
||
```toml | ||
[dependencies] | ||
linked-list = { version = "0.0.3", features = ["serde"] } | ||
``` | ||
|
||
<!-- cargo-rdme start --> | ||
|
||
### Description | ||
|
||
An alternative implementation of standard `LinkedList` featuring a prototype `Cursor`. | ||
|
||
<!-- cargo-rdme end --> | ||
|
||
## License | ||
|
||
Dual-licensed for compatibility with the Rust project. | ||
|
||
Licensed under the Apache License Version 2.0: http://www.apache.org/licenses/LICENSE-2.0, | ||
or the MIT license: http://opensource.org/licenses/MIT, at your option. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.