qryxip / cargo-equip

A Cargo subcommand to bundle your code into one `.rs` file for competitive programming
Apache License 2.0
82 stars 12 forks source link

Feature Request: Support local run, so it's necessary to import replaced modules with self:: prefix. #208

Open LumaKernel opened 1 month ago

LumaKernel commented 1 month ago

Currently, we'll get the error like following:

error[E0659]: `memoise` is ambiguous
 --> src/bin/main_equiped.rs:3:5
  |
3 | use memoise::memoise;
  |     ^^^^^^^ ambiguous name
  |
  = note: ambiguous because of multiple potential import sources
  = note: `memoise` could refer to a crate passed with `--extern`
  = help: use `::memoise` to refer to this crate unambiguously
note: `memoise` could also refer to the module imported here

To suppress these, we can add self:: for them.

LumaKernel commented 1 month ago

For normal imports, we need to replace only if it's not excluded.