Skip to content

Commit

Permalink
perf(grit): use to_ascii_lowercase_cow (#4053)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 authored Sep 23, 2024
1 parent 5df4e8b commit 20a726c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions crates/biome_grit_syntax/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ repository.workspace = true
version = "0.5.7"

[dependencies]
biome_rowan = { workspace = true, features = ["serde"] }
schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
biome_rowan = { workspace = true, features = ["serde"] }
biome_string_case = { workspace = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }

[features]
schema = ["schemars", "biome_rowan/serde"]
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_grit_syntax/src/file_source.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use biome_rowan::FileSourceError;
use biome_string_case::StrExtension;
use std::{ffi::OsStr, path::Path};
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(
Expand Down Expand Up @@ -59,7 +60,6 @@ impl TryFrom<&Path> for GritFileSource {
};
// We assume the file extensions are case-insensitive
// and we use the lowercase form of them for pattern matching
#[allow(clippy::disallowed_methods)]
Self::try_from_extension(&extension.to_ascii_lowercase())
Self::try_from_extension(&extension.to_ascii_lowercase_cow())
}
}

0 comments on commit 20a726c

Please sign in to comment.