Skip to content

Commit 764589f

Browse files
Cargo clippy updates for Rust 1.81
Signed-off-by: Kate Goldenring <[email protected]>
1 parent ac39eda commit 764589f

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323

2424
env:
2525
CARGO_TERM_COLOR: always
26-
RUST_VERSION: "1.80"
26+
RUST_VERSION: "1.81"
2727
jobs:
2828
lint-rust:
2929
name: Lint Rust

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ concurrency: ${{ github.workflow }}
2020

2121
env:
2222
CARGO_TERM_COLOR: always
23-
RUST_VERSION: "1.80"
23+
RUST_VERSION: "1.81"
2424

2525
jobs:
2626
build:

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = { workspace = true }
88
version = "0.10.0"
99
authors = ["Fermyon Engineering <[email protected]>"]
1010
edition = "2021"
11-
rust-version = "1.80"
11+
rust-version = "1.81"
1212

1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

src/commands/deploy.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,11 @@ fn check_safe_app_name(name: &str) -> Result<()> {
578578
// The path consists of slash-separated components. Each component may contain lowercase letters, digits and separators.
579579
// A separator is defined as a period, one or two underscores, or one or more hyphens. A component may not start or end with a separator.
580580
fn sanitize_app_name(name: &str) -> String {
581+
let trim_chars = ['.', '_', '-'];
581582
name.to_ascii_lowercase()
582583
.replace(' ', "")
583-
.trim_start_matches(|c: char| c == '.' || c == '_' || c == '-')
584-
.trim_end_matches(|c: char| c == '.' || c == '_' || c == '-')
584+
.trim_start_matches(trim_chars)
585+
.trim_end_matches(trim_chars)
585586
.to_string()
586587
}
587588

@@ -590,9 +591,7 @@ fn sanitize_app_name(name: &str) -> String {
590591
// A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and hyphens.
591592
// A tag name may not start with a period or a hyphen and may contain a maximum of 128 characters.
592593
fn sanitize_app_version(tag: &str) -> String {
593-
let mut sanitized = tag
594-
.trim()
595-
.trim_start_matches(|c: char| c == '.' || c == '-');
594+
let mut sanitized = tag.trim().trim_start_matches(['.', '-']);
596595

597596
if sanitized.len() > 128 {
598597
(sanitized, _) = sanitized.split_at(128);

0 commit comments

Comments
 (0)