Skip to content

Commit 49f40d2

Browse files
authored
Merge pull request #22 from contain-rs/new-features
Add more features: allocator-api2, no_std and (de)serialization
2 parents 5b69cc2 + 0844a8a commit 49f40d2

File tree

9 files changed

+703
-107
lines changed

9 files changed

+703
-107
lines changed

.github/workflows/rust.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Build
18+
run: cargo build --verbose
19+
- run: cargo test --verbose
20+
- run: cargo test --features serde --verbose
21+
- run: cargo test --features miniserde --verbose
22+
- run: cargo test --features nanoserde --verbose
23+
- run: cargo test --features borsh --verbose
24+
- run: cargo test --no-default-features --verbose
25+
- run: cargo test --no-default-features --features serde_no_std --verbose
26+
27+
miri:
28+
name: "Miri"
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Install Miri
33+
run: |
34+
rustup toolchain install nightly --component miri
35+
rustup override set nightly
36+
cargo miri setup
37+
- name: Test with Miri
38+
run: MIRIFLAGS=-Zmiri-strict-provenance cargo miri test
39+
40+
fmt:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: dtolnay/rust-toolchain@master
45+
with:
46+
toolchain: stable
47+
components: rustfmt
48+
- run: cargo fmt --all -- --check
49+
50+
51+
clippy:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: dtolnay/rust-toolchain@master
56+
with:
57+
toolchain: stable
58+
components: clippy
59+
- run: cargo clippy --workspace --tests --examples
60+
61+
62+
docs:
63+
runs-on: ubuntu-latest
64+
env:
65+
RUSTDOCFLAGS: -Dwarnings
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: dtolnay/rust-toolchain@master
69+
with:
70+
toolchain: stable
71+
- uses: swatinem/rust-cache@v2
72+
- run: cargo doc --workspace --no-deps
73+
74+
msrv:
75+
name: Rust ${{matrix.rust}}
76+
runs-on: ubuntu-latest
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
rust: [1.67.0, 1.68.0]
81+
timeout-minutes: 45
82+
steps:
83+
- uses: actions/checkout@v3
84+
- uses: dtolnay/rust-toolchain@master
85+
with:
86+
toolchain: ${{matrix.rust}}
87+
- run: cargo test --verbose
88+
- run: cargo test --features serde --verbose
89+
- run: cargo test --features miniserde --verbose
90+
- run: cargo test --features nanoserde --verbose
91+
- run: cargo test --features borsh --verbose
92+
- run: cargo test --no-default-features --verbose
93+
- run: cargo test --no-default-features --features serde_no_std --verbose

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
target
2-
Cargo.lock
1+
/target
2+
/Cargo.lock

.travis.yml

-18
This file was deleted.

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"rust-analyzer.cargo.features": ["serde", "miniserde", "nanoserde", "borsh"]
3+
}

Cargo.toml

+25-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,40 @@
22

33
name = "linked-list"
44
version = "0.0.3"
5-
license = "MIT/Apache-2.0"
5+
license = "MIT OR Apache-2.0"
66
description = "An alternative implementation of std::collections::LinkedList"
77

88
authors = [
99
"Alexis Beingessner <[email protected]>",
10+
"Peter Blackson <[email protected]>",
1011
]
1112

13+
edition = "2021"
14+
rust-version = "1.67"
15+
1216
repository = "https://github.com/contain-rs/linked-list"
1317
homepage = "https://github.com/contain-rs/linked-list"
14-
documentation = "https://contain-rs.github.io/linked-list/linked_list"
18+
documentation = "https://docs.rs/linked-list/latest/linked_list"
1519
keywords = ["data-structures"]
1620
readme = "README.md"
1721

22+
[dependencies]
23+
allocator-api2 = "0.2.20"
24+
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
25+
borsh = { version = "1.5", default-features = false, features = ["derive", "std"], optional = true }
26+
miniserde = { version = "0.1", optional = true }
27+
nanoserde = { version = "0.1", optional = true }
28+
29+
[dev-dependencies]
30+
serde_json = "1.0"
31+
1832
[features]
19-
nightly = []
33+
default = ["std"]
34+
std = []
35+
36+
serde_std = ["std", "serde/std"]
37+
serde_no_std = ["serde/alloc"]
38+
borsh = ["dep:borsh", "std"]
39+
40+
[package.metadata.docs.rs]
41+
features = ["serde", "miniserde", "nanoserde", "borsh"]

LICENSE-MIT

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015 The Rust Project Developers
1+
Copyright (c) 2015-2024 The Rust Project Developers
22

33
Permission is hereby granted, free of charge, to any
44
person obtaining a copy of this software and associated

README.md

+65-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,66 @@
1-
An alternative implementation of `std::collections::LinkedList` featuring a prototype Cursor.
1+
<div align="center">
2+
<h1>linked-list</h1>
3+
<p>
4+
<strong>A simple linked list.</strong>
5+
</p>
6+
<p>
27

3-
Documentation is available at https://contain-rs.github.io/linked-list/linked_list.
8+
[![crates.io][crates.io shield]][crates.io link]
9+
[![Documentation][docs.rs badge]][docs.rs link]
10+
![Rust CI][github ci badge]
11+
![Minimum Supported Rustc Version][rustc 1.67+]
12+
<br />
13+
<br />
14+
[![Dependency Status][deps.rs status]][deps.rs link]
15+
[![Download Status][shields.io download count]][crates.io link]
16+
17+
</p>
18+
</div>
19+
20+
[crates.io shield]: https://img.shields.io/crates/v/linked-list?label=latest
21+
[crates.io link]: https://crates.io/crates/linked-list
22+
[docs.rs badge]: https://docs.rs/linked-list/badge.svg?version=0.0.3
23+
[docs.rs link]: https://docs.rs/linked-list/0.0.3/linked_list/
24+
[github ci badge]: https://github.com/contain-rs/linked-list/workflows/Rust/badge.svg?branch=master
25+
[rustc 1.67+]: https://img.shields.io/badge/rustc-1.67%2B-blue.svg
26+
[deps.rs status]: https://deps.rs/crate/linked-list/0.0.3/status.svg
27+
[deps.rs link]: https://deps.rs/crate/linked-list/0.0.3
28+
[shields.io download count]: https://img.shields.io/crates/d/linked-list.svg
29+
30+
## Usage
31+
32+
Add this to your Cargo.toml:
33+
34+
```toml
35+
[dependencies]
36+
linked-list = "0.0.3"
37+
```
38+
39+
Since Rust 2018, `extern crate` is no longer mandatory. If your edition is old (Rust 2015),
40+
add this to your crate root:
41+
42+
```rust
43+
extern crate linked_list;
44+
```
45+
46+
If you want [serde](https://github.com/serde-rs/serde) support, include the feature like this:
47+
48+
```toml
49+
[dependencies]
50+
linked-list = { version = "0.0.3", features = ["serde"] }
51+
```
52+
53+
<!-- cargo-rdme start -->
54+
55+
### Description
56+
57+
An alternative implementation of standard `LinkedList` featuring a prototype `Cursor`.
58+
59+
<!-- cargo-rdme end -->
60+
61+
## License
62+
63+
Dual-licensed for compatibility with the Rust project.
64+
65+
Licensed under the Apache License Version 2.0: http://www.apache.org/licenses/LICENSE-2.0,
66+
or the MIT license: http://opensource.org/licenses/MIT, at your option.

deploy-docs.sh

-20
This file was deleted.

0 commit comments

Comments
 (0)