Skip to content

Commit

Permalink
Lower MSRV to 1.63
Browse files Browse the repository at this point in the history
  • Loading branch information
CathalMullan committed Jan 5, 2025
1 parent db85702 commit b6dd286
Show file tree
Hide file tree
Showing 13 changed files with 208 additions and 174 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 32 additions & 52 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,44 @@
resolver = "2"
members = [".", "examples/*", "fuzz"]

[workspace.package]
[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3

[profile.release]
lto = "fat"
codegen-units = 1

# https://doc.rust-lang.org/cargo/reference/manifest.html
[package]
name = "wayfind"
description = "A speedy, flexible router."
include = [
"/benches",
"/examples",
"/fuzz",
"/src",
"/tests",
"/ARCHITECTURE.md",
"/BENCHMARKING.md",
"/CHANGELOG.md",
"/LICENSE-APACHE",
"/LICENSE-MIT",
"/README.md",
]

version = "0.7.0"
authors = ["Cathal Mullan <contact@cathal.dev>"]
edition = "2021"
rust-version = "1.83"
# https://packages.debian.org/stable/rust/rustc
rust-version = "1.63"
repository = "https://github.com/DuskSystems/wayfind"
license = "MIT OR Apache-2.0"
keywords = ["router"]
categories = ["network-programming", "web-programming"]

# https://doc.rust-lang.org/rustc/lints/groups.html
[workspace.lints.rust]
[lints.rust]
unsafe_code = "forbid"

unused = { level = "deny", priority = -2 }
Expand All @@ -28,7 +54,7 @@ rust-2018-idioms = { level = "deny", priority = -1 }
rust-2021-compatibility = { level = "deny", priority = -1 }

# https://rust-lang.github.io/rust-clippy/master/index.html
[workspace.lints.clippy]
[lints.clippy]
cargo = { level = "deny", priority = -1 }
complexity = { level = "deny", priority = -1 }
correctness = { level = "deny", priority = -1 }
Expand All @@ -46,62 +72,16 @@ new_without_default = "allow"
str_to_string = "deny"
too_many_lines = "allow"

[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3

[profile.release]
lto = "fat"
codegen-units = 1

[workspace.dependencies]
[dependencies]
# Data Structures
smallvec = { version = "1.13", features = ["const_generics", "union"] }

[dev-dependencies]
# Testing
# NOTE: Keep in sync with `cargo-insta` Nix package.
insta = "=1.41.1"
similar-asserts = "1.6"

# https://doc.rust-lang.org/cargo/reference/manifest.html
[package]
name = "wayfind"
description = "A speedy, flexible router."
include = [
"/benches",
"/crates",
"/examples",
"/fuzz",
"/src",
"/tests",
"/ARCHITECTURE.md",
"/CHANGELOG.md",
"/LICENSE-APACHE",
"/LICENSE-MIT",
"/README.md",
]

version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

[dependencies]
# Data Structures
smallvec = { workspace = true }

[dev-dependencies]
# Testing
insta = { workspace = true }
similar-asserts = { workspace = true }

# Benchmarking
divan = "0.1"
criterion = { version = "0.5", features = ["html_reports"] }
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![crates.io](https://img.shields.io/crates/v/wayfind)](https://crates.io/crates/wayfind)
[![documentation](https://docs.rs/wayfind/badge.svg)](https://docs.rs/wayfind)

![rust: 1.83+](https://img.shields.io/badge/rust-1.83+-orange.svg)
![rust: 1.63+](https://img.shields.io/badge/rust-1.63+-orange.svg)
![`unsafe`: forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)
![`wasm`: compatible](https://img.shields.io/badge/wasm-compatible-success.svg)

Expand Down Expand Up @@ -305,6 +305,8 @@ fn main() -> Result<(), Box<dyn Error>> {

Routers can print their routes.

`[*]` denotes nodes within the tree that can be matched against.

Currenty, this doesn't handle split multi-byte characters well.

#### Example
Expand Down
4 changes: 1 addition & 3 deletions benches/matchit_criterion.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! Benches sourced from `matchit` (MIT AND BSD-3-Clause)
//! <https://github.com/ibraheemdev/matchit/blob/v0.8.5/benches/bench.rs>
use std::hint::black_box;

use codspeed_criterion_compat::{criterion_group, criterion_main, Criterion};
use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Criterion};
use matchit_routes::paths;

pub mod matchit_routes;
Expand Down
3 changes: 1 addition & 2 deletions benches/matchit_divan.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Benches sourced from `matchit` (MIT AND BSD-3-Clause)
//! <https://github.com/ibraheemdev/matchit/blob/v0.8.5/benches/bench.rs>
use std::hint::black_box;

use codspeed_criterion_compat::black_box;
use divan::AllocProfiler;
use matchit_routes::paths;

Expand Down
4 changes: 1 addition & 3 deletions benches/path_tree_criterion.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! Benches sourced from `path-tree` (MIT OR Apache-2.0)
//! <https://github.com/viz-rs/path-tree/blob/v0.8.1/benches/bench.rs>
use std::hint::black_box;

use codspeed_criterion_compat::{criterion_group, criterion_main, Criterion};
use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Criterion};
use path_tree_routes::paths;

pub mod path_tree_routes;
Expand Down
3 changes: 1 addition & 2 deletions benches/path_tree_divan.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Benches sourced from `path-tree` (MIT OR Apache-2.0)
//! <https://github.com/viz-rs/path-tree/blob/v0.8.1/benches/bench.rs>
use std::hint::black_box;

use codspeed_criterion_compat::black_box;
use divan::AllocProfiler;
use path_tree_routes::paths;

Expand Down
49 changes: 40 additions & 9 deletions examples/oci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,49 @@
[package]
name = "wayfind-oci-example"
description = "Example of using `wayfind` as an OCI registry."
rust-version = "1.83"
publish = false

version.workspace = true
authors.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
version = "0.7.0"
authors = ["Cathal Mullan <contact@cathal.dev>"]
edition = "2021"
repository = "https://github.com/DuskSystems/wayfind"
license = "MIT OR Apache-2.0"
keywords = ["router"]
categories = ["network-programming", "web-programming"]

[lints]
workspace = true
# https://doc.rust-lang.org/rustc/lints/groups.html
[lints.rust]
unsafe_code = "forbid"

unused = { level = "deny", priority = -2 }
future-incompatible = { level = "deny", priority = -1 }
keyword-idents = { level = "deny", priority = -1 }
let-underscore = { level = "deny", priority = -1 }
nonstandard-style = { level = "deny", priority = -1 }
refining-impl-trait = { level = "deny", priority = -1 }
rust-2018-compatibility = { level = "deny", priority = -1 }
rust-2018-idioms = { level = "deny", priority = -1 }
rust-2021-compatibility = { level = "deny", priority = -1 }

# https://rust-lang.github.io/rust-clippy/master/index.html
[lints.clippy]
cargo = { level = "deny", priority = -1 }
complexity = { level = "deny", priority = -1 }
correctness = { level = "deny", priority = -1 }
nursery = { level = "deny", priority = -1 }
pedantic = { level = "deny", priority = -1 }
perf = { level = "deny", priority = -1 }
style = { level = "deny", priority = -1 }
suspicious = { level = "deny", priority = -1 }

# Personal Preferences
clone_on_ref_ptr = "deny"
cognitive_complexity = "allow"
module_name_repetitions = "allow"
new_without_default = "allow"
str_to_string = "deny"
too_many_lines = "allow"

[dependencies]
wayfind = { path = "../.." }
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@

buildInputs = with pkgs; [
# Rust
(rust-bin.stable."1.83.0".minimal)
(rust-bin.stable."1.63.0".minimal)
sccache
];
};
Expand All @@ -164,7 +164,7 @@

buildInputs = with pkgs; [
# Rust
(rust-bin.stable."1.83.0".minimal.override {
(rust-bin.stable."1.63.0".minimal.override {
targets = [ "wasm32-unknown-unknown" ];
extensions = [
"clippy"
Expand Down
4 changes: 2 additions & 2 deletions src/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<T, S: NodeState> Node<'_, T, S> {

match data {
NodeData::Inline { data, .. } => Some(data),
NodeData::Shared { data, .. } => Arc::into_inner(data),
NodeData::Shared { data, .. } => Arc::try_unwrap(data).ok(),
}
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@ impl<T, S: NodeState> Node<'_, T, S> {

match data {
NodeData::Inline { data, .. } => Some(data),
NodeData::Shared { data, .. } => Arc::into_inner(data),
NodeData::Shared { data, .. } => Arc::try_unwrap(data).ok(),
}
}

Expand Down
Loading

0 comments on commit b6dd286

Please sign in to comment.