Skip to content

Conversation

ahomescu
Copy link
Contributor

@ahomescu ahomescu commented Oct 7, 2025

Add an extra step to reorganize_definitions that checks for every path if it is already imported into the current module, and uses the short import instead of the fully qualified path. E.g.

use crate::foo::Bar;
// Was: fn foo(x: crate::foo::Bar) {}
fn foo(x: Bar) {}

@ahomescu ahomescu requested a review from fw-immunant October 7, 2025 22:50
// If any items are imported into the current module,
// use the short paths, e.g., bar instead of crate::foo::bar
//
// TODO: this could be a separate transform
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What transform is it part of? Reorganize definitions? It definitely seems super useful on its own.

@ahomescu ahomescu force-pushed the ahomescu/reorganize_shorten_paths branch from 6aa13a0 to 21dd85a Compare October 8, 2025 23:03
@ahomescu ahomescu force-pushed the ahomescu/fix_reorganize_definitions branch from 6d527b1 to 8edb5f0 Compare October 8, 2025 23:03
@ahomescu ahomescu force-pushed the ahomescu/reorganize_shorten_paths branch from 21dd85a to 734be7a Compare October 8, 2025 23:10
@ahomescu ahomescu force-pushed the ahomescu/fix_reorganize_definitions branch from 8edb5f0 to b6d2c9e Compare October 8, 2025 23:10
@ahomescu ahomescu force-pushed the ahomescu/reorganize_shorten_paths branch from 734be7a to 92dd2e9 Compare October 8, 2025 23:13
@ahomescu ahomescu force-pushed the ahomescu/fix_reorganize_definitions branch 2 times, most recently from cd518be to 9804b07 Compare October 8, 2025 23:20
@ahomescu ahomescu force-pushed the ahomescu/reorganize_shorten_paths branch from 92dd2e9 to 7752cc3 Compare October 8, 2025 23:20
@ahomescu ahomescu force-pushed the ahomescu/reorganize_shorten_paths branch from 7752cc3 to f5a88e8 Compare October 14, 2025 21:01
@ahomescu ahomescu force-pushed the ahomescu/fix_reorganize_definitions branch from 9804b07 to 9b5ba1b Compare October 14, 2025 21:01
Base automatically changed from ahomescu/fix_reorganize_definitions to master October 14, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants