style: restrict unused_trait_names for trait imports#2542
Merged
CommanderStorm merged 1 commit intomaplibre:mainfrom Feb 6, 2026
Merged
style: restrict unused_trait_names for trait imports#2542CommanderStorm merged 1 commit intomaplibre:mainfrom
unused_trait_names for trait imports#2542CommanderStorm merged 1 commit intomaplibre:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enforces a stricter code style by enabling the unused_trait_names clippy lint (part of the "restrictions" category), requiring all trait imports to use anonymous syntax (as _). This makes trait usage more explicit by distinguishing traits imported solely for their extension methods from types that are used by name.
Changes:
- Added
unused_trait_names = "warn"to the workspace Clippy lints in alphabetical order - Updated all trait imports across the codebase to use
as _syntax - No functional changes - purely stylistic enforcement
Reviewed changes
Copilot reviewed 31 out of 34 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Added unused_trait_names lint to workspace restrictions (alphabetically ordered) |
| mbtiles/tests/streams.rs | Renamed StreamExt, TryStreamExt trait imports to anonymous |
| mbtiles/tests/copy.rs | Renamed Row trait import to anonymous |
| mbtiles/src/validation.rs | Renamed Row trait import to anonymous |
| mbtiles/src/summary.rs | Renamed FromStr trait import to anonymous |
| mbtiles/src/queries.rs | Renamed Row trait import to anonymous |
| mbtiles/src/metadata.rs | Renamed FromStr, TryStreamExt trait imports to anonymous |
| mbtiles/src/mbtiles.rs | Renamed Connection, Executor, Row, Statement, StreamExt trait imports to anonymous |
| mbtiles/src/copier.rs | Renamed Row trait import to anonymous |
| mbtiles/src/bindiff.rs | Renamed TryStreamExt, Executor, Row trait imports to anonymous |
| mbtiles/src/bin/mbtiles.rs | Renamed Parser trait import to anonymous |
| martin/src/srv/tiles/metadata.rs | Renamed ToString trait import to anonymous |
| martin/src/srv/tiles/content.rs | Renamed HttpMessage, TryIntoHeaderValue trait imports to anonymous |
| martin/src/srv/sprites.rs | Renamed ToString trait import to anonymous |
| martin/src/srv/server.rs | Renamed ToString, TryFutureExt trait imports to anonymous |
| martin/src/srv/fonts.rs | Renamed ToString trait import to anonymous |
| martin/src/config/file/tiles/postgres/utils.rs | Renamed Itertools trait import to anonymous |
| martin/src/config/file/tiles/postgres/resolver/query_tables.rs | Renamed PostgresInfo, LineString, Point, Polygon trait imports to anonymous |
| martin/src/config/file/tiles/postgres/config.rs | Renamed Add trait import to anonymous |
| martin/src/config/file/tiles/postgres/builder.rs | Renamed ImageExt, AsyncRunner trait imports to anonymous |
| martin/src/config/file/tiles/pmtiles.rs | Renamed FromStr trait import to anonymous |
| martin/src/config/file/tiles/mbtiles.rs | Renamed ConfigurationLivecycleHooks trait import to anonymous |
| martin/src/config/file/main.rs | Renamed ConfigurationLivecycleHooks trait import to anonymous |
| martin/src/bin/martin.rs | Renamed Parser trait import to anonymous |
| martin/src/bin/martin-cp.rs | Renamed TryStreamExt, StreamExt, FromStr trait imports to anonymous |
| martin/benches/postgres_discovery.rs | Renamed ImageExt, SyncRunner trait imports to anonymous |
| martin-tile-utils/src/lib.rs | Renamed Write trait import to anonymous (3 occurrences) |
| martin-core/tests/pmtiles_test.rs | Renamed Source, DirectoryCache trait imports to anonymous |
| martin-core/src/tiles/tile.rs | Renamed Engine trait import to anonymous |
| martin-core/src/tiles/postgres/tls.rs | Renamed FromStr trait import to anonymous |
| martin-core/src/resources/sprites/mod.rs | Renamed AsyncReadExt trait import to anonymous |
| martin-core/src/resources/fonts/mod.rs | Renamed Message trait import to anonymous |
| martin-core/src/config/env.rs | Renamed OsStrExt trait import to anonymous |
| martin-core/examples/pmtiles-tileserver.rs | Renamed Source trait import to anonymous |
CommanderStorm
approved these changes
Feb 6, 2026
Merged
CommanderStorm
added a commit
that referenced
this pull request
Feb 11, 2026
## 🤖 New release
* `martin-tile-utils`: 0.6.9 -> 0.6.10 (✓ API compatible changes)
* `mbtiles`: 0.15.1 -> 0.15.2 (✓ API compatible changes)
* `martin-core`: 0.2.6 -> 0.3.0 (⚠ API breaking changes)
* `martin`: 1.3.0 -> 2.0.0
### ⚠ `martin-core` breaking changes
```text
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/enum_missing.ron
Failed in:
enum martin_core::config::OptOneMany, previously in file /tmp/.tmpiF3o7Z/martin-core/src/config/cfg_containers.rs:29
enum martin_core::config::OptBoolObj, previously in file /tmp/.tmpiF3o7Z/martin-core/src/config/cfg_containers.rs:8
--- failure module_missing: pub module removed or renamed ---
Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/module_missing.ron
Failed in:
mod martin_core::config, previously in file /tmp/.tmpiF3o7Z/martin-core/src/config/mod.rs:1
mod martin_core::config::env, previously in file /tmp/.tmpiF3o7Z/martin-core/src/config/env.rs:1
--- failure struct_missing: pub struct removed or renamed ---
Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/struct_missing.ron
Failed in:
struct martin_core::config::env::OsEnv, previously in file /tmp/.tmpiF3o7Z/martin-core/src/config/env.rs:53
struct martin_core::config::IdResolver, previously in file /tmp/.tmpiF3o7Z/martin-core/src/config/id_resolver.rs:10
struct martin_core::config::env::FauxEnv, previously in file /tmp/.tmpiF3o7Z/martin-core/src/config/env.rs:76
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/trait_missing.ron
Failed in:
trait martin_core::config::env::Env, previously in file /tmp/.tmpiF3o7Z/martin-core/src/config/env.rs:20
```
<details><summary><i><b>Changelog</b></i></summary><p>
## `mbtiles`
<blockquote>
##
[0.15.2](mbtiles-v0.15.1...mbtiles-v0.15.2)
- 2026-02-11
### Other
- restrict `unused_trait_names` for trait imports
([#2542](#2542))
</blockquote>
## `martin-core`
<blockquote>
##
[0.3.0](martin-core-v0.2.6...martin-core-v0.3.0)
- 2026-02-11
### Added
- *(unstable-cog)* Change tile path semantics for COG sources to match
other sources, expose COG bounds, center and tileSize in TileJSON
([#2510](#2510))
### Other
- *(martin-core)* [**breaking**] remove the configration from the
martin-core crate
([#2521](#2521))
- restrict `unused_trait_names` for trait imports
([#2542](#2542))
</blockquote>
## `martin`
<blockquote>
##
[2.0.0](martin-v1.3.0...martin-v2.0.0)
- 2026-02-11
### Added
- *(srv)* Add HTTP 301 redirects for common URL mistakes
([#2528](#2528))
- *(unstable-cog)* Change tile path semantics for COG sources to match
other sources, expose COG bounds, center and tileSize in TileJSON
([#2510](#2510))
### Fixed
- logs not being integrated with the `path-prefix` correctly
([#2549](#2549))
- Make sure that `route-prefix` does not break the UI when using
trailing slash urls
([#2541](#2541))
### Other
- *(deps)* Bump the all-npm-version-updates group across 2 directories
with 7 updates ([#2553](#2553))
- Add test coverage for header handling in tilejson requests
([#2529](#2529))
- *(martin-core)* [**breaking**] remove the configration from the
martin-core crate
([#2521](#2521))
- *(deps)* autoupdate pre-commit
([#2545](#2545))
- restrict `unused_trait_names` for trait imports
([#2542](#2542))
- *(deps)* Bump the all-npm-version-updates group across 2 directories
with 12 updates ([#2533](#2533))
</blockquote>
</p></details>
---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pedantic is just too weak... restrictions are so much more fun!