auto-import

Crates.ioauto-import
lib.rsauto-import
version0.1.0
sourcesrc
created_at2022-05-19 08:57:20.551979
updated_at2022-05-19 08:57:20.551979
descriptionPlease do not use this.
homepage
repositoryhttps://github.com/m-ou-se/auto-import
max_upload_size
id589581
size6,070
Mara Bos (m-ou-se)

documentation

README

auto-import

The auto_import::magic!{} macro expands to whatever use statements you need to make the rest of the code compile.

https://twitter.com/m_ou_se/status/1527209443309633536

Please do not use this.

Example

auto_import::magic!();

fn main() {
    let _ = BTreeMap::<File, PathBuf>::new();
    let _ = i32::from_str("123");
    std::io::stdout().write_all(b"!\n").unwrap();
}
$ cargo run
   Compiling auto-import v0.1.0
   Compiling example v0.1.0
   Injecting use std::collections::BTreeMap;
   Injecting use std::fs::File;
   Injecting use std::path::PathBuf;
   Injecting use std::str::FromStr;
   Injecting use std::io::Write;
    Finished dev [unoptimized + debuginfo] target(s) in 0.60s
     Running `target/debug/example`
!
Commit count: 1

cargo fmt