qryxip / cargo-equip

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

Make inserting `#![allow(unused_imports)]` optional #132

Closed ghost closed 3 years ago

ghost commented 3 years ago

In #126, #![allow(unused_imports)] attribute is always inserted in the top of every bundled code.

As one of the user, I would prefer to write the attribute by myself because of ignore the unused warnings than to be bundled automatically and duplicated.

Changes

qryxip commented 3 years ago

The reason I inserted #![allow(unused_imports)] was to allow use for procedural macros without warning.

(edit) I mean, I intended to add just a workaround.

use proconio::fastout;
//  ^^^^^^^^^^^^^^^^^
//  warning: unused import: `proconio::fastout`

/*#[fastout]
fn main() { … }*/
fn main() { … }

// …

pub __bundled {
    pub proconio { /* … */}
}

However, in yesterday I came up with this:

use proconio::{fastout, input};

use proconio::{/*fastout,*/ input};
#[allow(unused_imports)]
use proconio::fastout;

With this idea, #![allow(unused_imports)] is unnecessary. So I'm afraid I'm closing PR. Thank you for pointing the problem out.