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..30a748d 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: @@ -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' 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 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`.