Rust: types written with their full path instead of imported #355

Closed
opened 2026-10-23 18:00:04 -07:00 by rays · 1 comment
Owner

The style guide imports type names and uses them unqualified. 437 places outside tests write paths such as std::collections::HashMap<..>, std::time::Instant or std::sync::Arc inline (2026-10-24): main.rs 75, db.rs 60, web.rs 38, signals.rs 33, feed/src/lib.rs 32, directory.rs 31.

The style guide imports type names and uses them unqualified. 437 places outside tests write paths such as `std::collections::HashMap<..>`, `std::time::Instant` or `std::sync::Arc` inline (2026-10-24): main.rs 75, db.rs 60, web.rs 38, signals.rs 33, feed/src/lib.rs 32, directory.rs 31.
rays added the enhancement label 2026-10-23 18:00:04 -07:00
Author
Owner

Done in f22c199: 222 inline type paths are now imports and bare names, file by file, where the name is unambiguous in that file. 193 stay qualified on purpose: common names the guide's exception covers (reqwest::Client, anyhow::Error/Result, std::sync::Mutex beside tokio's, serde_json::Value beside sea_orm's, Ordering::Relaxed), names a file uses from two paths (std and tokio Instant), and paths in test-only code or under a function's own import. No behaviour change; tests and clippy pass.

Done in f22c199: 222 inline type paths are now imports and bare names, file by file, where the name is unambiguous in that file. 193 stay qualified on purpose: common names the guide's exception covers (reqwest::Client, anyhow::Error/Result, std::sync::Mutex beside tokio's, serde_json::Value beside sea_orm's, Ordering::Relaxed), names a file uses from two paths (std and tokio Instant), and paths in test-only code or under a function's own import. No behaviour change; tests and clippy pass.
rays closed this issue 2026-10-23 18:19:15 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#355