Skip to content

Commit

Permalink
fix: trivially_copy_pass_by_ref lint (#1654)
Browse files Browse the repository at this point in the history
As noticed in #1649, this lint
fails if chainging the default and thus making it run.

For `Copy`-enums this should basically be the same thing, should as far
as I understood not even be an API-breaking change.

Perf-wise, the compiler should be able to optimise it the same way in
the end
=> sadly likely won't have a performance impact
  • Loading branch information
CommanderStorm authored Jan 24, 2025
1 parent e3c929f commit 82503d5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions martin-tile-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ impl Format {

/// Get the `format` value as it should be stored in the `MBTiles` metadata table
#[must_use]
pub fn metadata_format_value(&self) -> &'static str {
match *self {
pub fn metadata_format_value(self) -> &'static str {
match self {
Self::Gif => "gif",
Self::Jpeg => "jpeg",
Self::Json => "json",
Expand All @@ -82,8 +82,8 @@ impl Format {
}

#[must_use]
pub fn is_detectable(&self) -> bool {
match *self {
pub fn is_detectable(self) -> bool {
match self {
Self::Png | Self::Jpeg | Self::Gif | Self::Webp => true,
// TODO: Json can be detected, but currently we only detect it
// when it's not compressed, so to avoid a warning, keeping it as false for now.
Expand Down Expand Up @@ -143,8 +143,8 @@ impl Encoding {
}

#[must_use]
pub fn is_encoded(&self) -> bool {
match *self {
pub fn is_encoded(self) -> bool {
match self {
Self::Uncompressed | Self::Internal => false,
Self::Gzip | Self::Zlib | Self::Brotli | Self::Zstd => true,
}
Expand Down

0 comments on commit 82503d5

Please sign in to comment.