Skip to content

Commit

Permalink
Merge pull request #125 from epage/update
Browse files Browse the repository at this point in the history
chore: Upgrade dependencies
  • Loading branch information
epage committed Nov 5, 2022
2 parents 3593f9e + 52e12ce commit af3a368
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
@@ -1 +1 @@
msrv = "1.54.0" # MSRV
msrv = "1.60.0" # MSRV
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -51,15 +51,15 @@ jobs:
- name: No-default features
run: cargo test --workspace --no-default-features
msrv:
name: "Check MSRV: 1.54.0"
name: "Check MSRV: 1.60.0"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.54.0 # MSRV
toolchain: 1.60.0 # MSRV
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.54.0 # MSRV
toolchain: 1.60.0 # MSRV
profile: minimal
override: true
components: clippy
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust-next.yml
Expand Up @@ -57,9 +57,9 @@ jobs:
strategy:
matrix:
rust:
- 1.54.0 # MSRV
- 1.60.0 # MSRV
- stable
continue-on-error: ${{ matrix.rust != '1.54.0' }} # MSRV
continue-on-error: ${{ matrix.rust != '1.60.0' }} # MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
13 changes: 7 additions & 6 deletions Cargo.toml
Expand Up @@ -13,7 +13,8 @@ documentation = "https://docs.rs/predicates"
readme = "README.md"
categories = ["data-structures", "rust-patterns"]
keywords = ["predicate", "boolean", "combinatorial", "match", "logic"]
edition = "2018"
edition = "2021"
rust-version = "1.60.0" # MSRV
include = [
"src/**/*",
"Cargo.toml",
Expand All @@ -40,15 +41,15 @@ normalize-line-endings = { version = "0.3.0", optional = true }
regex = { version="1.0", optional = true }
float-cmp = { version="0.9", optional = true }
itertools = "0.10"
yansi = { version = "0.5.0", optional = true }
concolor = { version = "0.0.8", optional = true }
yansi = { version = "0.5.1", optional = true }
concolor = { version = "0.0.9", optional = true }

[dev-dependencies]
predicates-tree = { version = "1.0", path = "crates/tree" }

[features]
default = ["diff", "regex", "float-cmp", "normalize-line-endings"]
diff = ["difflib"]
diff = ["dep:difflib"]
unstable = []
color = ["yansi", "concolor/std"]
color-auto = ["color", "concolor/auto"]
color = ["dep:yansi", "dep:concolor", "concolor?/std"]
color-auto = ["color", "concolor?/auto"]
3 changes: 2 additions & 1 deletion crates/core/Cargo.toml
Expand Up @@ -10,7 +10,8 @@ homepage = "https://github.com/assert-rs/predicates-rs/tree/master/predicates-co
documentation = "https://docs.rs/predicates-core"
categories = ["data-structures", "rust-patterns"]
keywords = ["predicate", "boolean", "combinatorial", "match", "logic"]
edition = "2018"
edition = "2021"
rust-version = "1.60.0" # MSRV
include = [
"src/**/*",
"Cargo.toml",
Expand Down
21 changes: 7 additions & 14 deletions crates/core/src/reflection.rs
Expand Up @@ -40,7 +40,7 @@ pub struct Parameter<'a>(&'a str, &'a dyn fmt::Display);
impl<'a> Parameter<'a> {
/// Create a new `Parameter`.
pub fn new(key: &'a str, value: &'a dyn fmt::Display) -> Self {
Self { 0: key, 1: value }
Self(key, value)
}

/// Access the `Parameter` name.
Expand Down Expand Up @@ -72,7 +72,7 @@ pub struct Child<'a>(&'a str, &'a dyn PredicateReflection);
impl<'a> Child<'a> {
/// Create a new `Predicate` child.
pub fn new(key: &'a str, value: &'a dyn PredicateReflection) -> Self {
Self { 0: key, 1: value }
Self(key, value)
}

/// Access the `Child`'s name.
Expand Down Expand Up @@ -141,16 +141,12 @@ impl<'a> Case<'a> {

/// Access the by-products from determining this case.
pub fn products(&self) -> CaseProducts<'_> {
CaseProducts {
0: self.products.iter(),
}
CaseProducts(self.products.iter())
}

/// Access the sub-cases.
pub fn children(&self) -> CaseChildren<'_> {
CaseChildren {
0: self.children.iter(),
}
CaseChildren(self.children.iter())
}
}

Expand Down Expand Up @@ -229,10 +225,7 @@ impl Product {
S: Into<borrow::Cow<'static, str>>,
D: fmt::Display + 'static,
{
Self {
0: key.into(),
1: Box::new(value),
}
Self(key.into(), Box::new(value))
}

/// Access the `Product` name.
Expand All @@ -246,13 +239,13 @@ impl Product {
}
}

impl<'a> fmt::Display for Product {
impl fmt::Display for Product {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}: {}", self.0, self.1)
}
}

impl<'a> fmt::Debug for Product {
impl fmt::Debug for Product {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "({:?}, {})", self.0, self.1)
}
Expand Down
3 changes: 2 additions & 1 deletion crates/tree/Cargo.toml
Expand Up @@ -10,7 +10,8 @@ homepage = "https://github.com/assert-rs/predicates-rs/tree/master/predicates-tr
documentation = "https://docs.rs/predicates-tree"
categories = ["data-structures", "rust-patterns"]
keywords = ["predicate", "boolean", "combinatorial", "match", "logic"]
edition = "2018"
edition = "2021"
rust-version = "1.60.0" # MSRV
include = [
"src/**/*",
"Cargo.toml",
Expand Down
2 changes: 1 addition & 1 deletion crates/tree/src/lib.rs
Expand Up @@ -41,7 +41,7 @@ fn convert(case: &reflection::Case<'_>) -> CaseTreeInner {
termtree::Tree::new(root).with_multiline(true)
}));

leaves.extend(case.children().map(|item| convert(item)));
leaves.extend(case.children().map(convert));

let root = Box::new(case.predicate().map(|p| p.to_string()).unwrap_or_default());
CaseTreeInner::new(root).with_leaves(leaves)
Expand Down

0 comments on commit af3a368

Please sign in to comment.