From 65b4e89b382e0b764caa145bc2d9c16751d878a5 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Mon, 9 Sep 2024 08:56:47 -0400 Subject: [PATCH 1/3] Test with Rust 1.81.0. --- .github/workflows/pre-commit.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/test.yaml | 6 +++--- .ignore | 2 ++ .pre-commit-config.yaml | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 43b4574..4a91156 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -13,7 +13,7 @@ on: workflow_dispatch: env: - RUST_VERSION: 1.80.0 + RUST_VERSION: 1.81.0 jobs: pre-commit: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c4776f6..197a470 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,7 +26,7 @@ env: name: row CARGO_TERM_COLOR: always CLICOLOR: 1 - RUST_VERSION: 1.80.0 + RUST_VERSION: 1.81.0 jobs: source: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 32551b7..e0c6b2c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,7 @@ env: CARGO_TERM_COLOR: always ROW_COLOR: always CLICOLOR: 1 - RUST_LATEST_VERSION: 1.80.0 + RUST_LATEST_VERSION: 1.81.0 jobs: unit_test: @@ -34,14 +34,14 @@ jobs: rust: # Oldest supported version of rust - 1.77.2 - - 1.80.0 + - 1.81.0 mode: - debug include: # Add a release build on linux with the latest version of rust - os: ubuntu-22.04 - rust: 1.80.0 + rust: 1.81.0 mode: release steps: diff --git a/.ignore b/.ignore index a22813c..fa4ba34 100644 --- a/.ignore +++ b/.ignore @@ -1,2 +1,4 @@ !/workflow.toml !/.ignore +!/*.yaml +!/.github diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a48299f..3bc7f6b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ ci: skip: [fmt, check, clippy] default_language_version: - rust: 1.80.0 + rust: 1.81.0 repos: - repo: https://github.com/backplane/pre-commit-rust-hooks From 9d6e7234bc989e760a18550b12595b017866f321 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Mon, 9 Sep 2024 11:08:20 -0400 Subject: [PATCH 2/3] Pass clippy checks. --- src/workflow.rs | 42 +++++++----------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/src/workflow.rs b/src/workflow.rs index 91ddff2..23bcc86 100644 --- a/src/workflow.rs +++ b/src/workflow.rs @@ -416,47 +416,27 @@ impl Resources { impl Action { /// Get the action's `name`. pub fn name(&self) -> &str { - if let Some(name) = self.name.as_ref() { - name - } else { - "" - } + self.name.as_deref().unwrap_or("") } /// Get the action's `command`. pub fn command(&self) -> &str { - if let Some(command) = self.command.as_ref() { - command - } else { - "" - } + self.command.as_deref().unwrap_or("") } /// Get the action's `launchers`. pub fn launchers(&self) -> &[String] { - if let Some(launchers) = self.launchers.as_ref() { - launchers - } else { - &[] - } + self.launchers.as_deref().unwrap_or(&[]) } /// Get the action's `previous_actions`. pub fn previous_actions(&self) -> &[String] { - if let Some(previous_actions) = self.previous_actions.as_ref() { - previous_actions - } else { - &[] - } + self.previous_actions.as_deref().unwrap_or(&[]) } /// Get the action's products pub fn products(&self) -> &[String] { - if let Some(products) = self.products.as_ref() { - products - } else { - &[] - } + self.products.as_deref().unwrap_or(&[]) } /// Resolve the action's omitted keys with defaults @@ -512,20 +492,12 @@ impl Action { impl Group { /// Get the group's `include`. pub fn include(&self) -> &[Selector] { - if let Some(include) = self.include.as_ref() { - include - } else { - &[] - } + self.include.as_deref().unwrap_or(&[]) } /// Get the group's `sort_by`. pub fn sort_by(&self) -> &[String] { - if let Some(sort_by) = self.sort_by.as_ref() { - sort_by - } else { - &[] - } + self.sort_by.as_deref().unwrap_or(&[]) } /// Get the group's `split_by_sort_key`. From 1ec8b14cd8fe56b2d6ab50daa3c979a79eb8babb Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Mon, 9 Sep 2024 11:16:33 -0400 Subject: [PATCH 3/3] Ignore links to arc.umich.edu. --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e0c6b2c..30a748d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -126,6 +126,7 @@ jobs: with: args: -n --exclude https://glotzerlab.engin.umich.edu + --exclude https://arc.umich.edu --exclude 'https://github.com/glotzerlab/row/edit.*' --exclude doi.org './**/*.md'