{"id":17147624,"url":"https://github.com/qryxip/cargo-equip","last_synced_at":"2025-04-07T13:08:32.833Z","repository":{"id":42870940,"uuid":"291428813","full_name":"qryxip/cargo-equip","owner":"qryxip","description":"A Cargo subcommand to bundle your code into one `.rs` file for competitive programming","archived":false,"fork":false,"pushed_at":"2024-03-12T09:13:43.000Z","size":853,"stargazers_count":88,"open_issues_count":21,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T11:06:57.701Z","etag":null,"topics":["cargo-subcommand","competitive-programming"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qryxip.png","metadata":{"files":{"readme":"README-ja.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-30T08:16:57.000Z","updated_at":"2025-02-15T18:46:20.000Z","dependencies_parsed_at":"2024-10-31T02:03:22.755Z","dependency_job_id":"ad040654-7e16-4da9-90f4-8f9086248202","html_url":"https://github.com/qryxip/cargo-equip","commit_stats":{"total_commits":304,"total_committers":3,"mean_commits":"101.33333333333333","dds":0.006578947368421018,"last_synced_commit":"1e71d4da86bfb99161fdbc8e024bae305794427d"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qryxip%2Fcargo-equip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qryxip%2Fcargo-equip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qryxip%2Fcargo-equip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qryxip%2Fcargo-equip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qryxip","download_url":"https://codeload.github.com/qryxip/cargo-equip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657281,"owners_count":20974345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo-subcommand","competitive-programming"],"created_at":"2024-10-14T21:25:29.623Z","updated_at":"2025-04-07T13:08:32.815Z","avatar_url":"https://github.com/qryxip.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# cargo-equip\n\n[![CI](https://github.com/qryxip/cargo-equip/workflows/CI/badge.svg)](https://github.com/qryxip/cargo-equip/actions?workflow=CI)\n[![codecov](https://codecov.io/gh/qryxip/cargo-equip/branch/master/graph/badge.svg)](https://codecov.io/gh/qryxip/cargo-equip/branch/master)\n[![dependency status](https://deps.rs/repo/github/qryxip/cargo-equip/status.svg)](https://deps.rs/repo/github/qryxip/cargo-equip)\n[![Crates.io](https://img.shields.io/crates/v/cargo-equip.svg)](https://crates.io/crates/cargo-equip)\n[![Crates.io](https://img.shields.io/crates/l/cargo-equip.svg)](https://crates.io/crates/cargo-equip)\n\n[English](https://github.com/qryxip/cargo-equip)\n\n競技プログラミング用にRustコードを一つの`.rs`ファイルにバンドルするCargoサブコマンドです。\n\n## 更新情報\n\n更新情報は[CHANGELOG.md](https://github.com/qryxip/cargo-equip/blob/master/CHANGELOG.md)にあります。\nまた同一の内容がGitHubのリリースページにあります。\n\n## 機能\n\n- 複数のクレートのバンドル\n- cargo-udepsにより使っているライブラリだけバンドル\n- 一部のクレートを除外 (`--exclude-{atcoder, codingame}-crates`),\n- 手続き型マクロの展開 (`bin`内のみ)\n- `#[macro_export]`のスコープを保持\n- `#[cfg(..)]`の解決\n- コメントおよびdocコメントの削除 (`--remove`)\n- minify機能 (`--minify`)\n- 生成物をコンパイルが通るかチェック\n\n## 例\n\n[Sqrt Mod - Library-Cheker](https://judge.yosupo.jp/problem/sqrt_mod)\n\n```toml\n[package]\nname = \"library-checker\"\nversion = \"0.0.0\"\nedition = \"2018\"\n\n[dependencies]\nac-library-rs-parted-modint = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nproconio = { version = \"0.4.3\", features = [\"derive\"] }\nqryxip-competitive-tonelli-shanks = { git = \"https://github.com/qryxip/competitive-programming-library\" }\n# ...\n```\n\n```rust\nuse acl_modint::ModInt;\nuse proconio::{fastout, input};\nuse tonelli_shanks::ModIntBaseExt as _;\n\n#[fastout]\nfn main() {\n    input! {\n        yps: [(u32, u32)],\n    }\n\n    for (y, p) in yps {\n        ModInt::set_modulus(p);\n        if let Some(x) = ModInt::new(y).sqrt() {\n            println!(\"{}\", x);\n        } else {\n            println!(\"-1\");\n        }\n    }\n}\n\nmod sub {\n    // You can also `use` the crate in submodules.\n\n    #[allow(unused_imports)]\n    use proconio::input as _;\n}\n```\n\n↓\n\n```console\n❯ cargo equip \\\n\u003e       --remove docs `# doc commentを除去` \\\n\u003e       --minify libs `# ライブラリをそれぞれ一行にminify` \\\n\u003e       --bin sqrt_mod `# binクレートを指定` | xsel -b\n```\n\n[Submit Info #59239 - Library-Checker](https://judge.yosupo.jp/submission/59239)\n\n## 動作するクレート\n\n- [x] [fixedbitset 0.4.0](https://docs.rs/crate/fixedbitset/0.4.0)\n- [x] [lazy_static 1.4.0](https://docs.rs/crate/lazy_static/1.4.0)\n- [x] [maplit 1.0.2](https://docs.rs/crate/maplit/1.0.2)\n- [x] [memoise 0.3.2](https://docs.rs/crate/memoise/0.3.2)\n- [x] [multimap 0.8.3](https://docs.rs/crate/multimap/0.8.3)\n- [x] [permutohedron 0.2.4](https://docs.rs/crate/permutohedron/0.2.4)\n- [x] [proconio 0.4.3](https://docs.rs/crate/proconio/0.4.3)\n- [x] [rustc-hash 1.1.0](https://docs.rs/crate/rustc-hash/1.1.0)\n- [x] [smallvec 1.6.1](https://docs.rs/crate/smallvec/1.6.1)\n- [x] [strsim 0.10.0](https://docs.rs/crate/strsim/0.10.0)\n- [x] [whiteread 0.5.0](https://docs.rs/crate/whiteread/0.5.0)\n\n## インストール\n\n`nightly`ツールチェインと[cargo-udeps](https://github.com/est31/cargo-udeps)もインストールしてください。\n\n```console\n❯ rustup update nightly\n```\n\n```console\n❯ cargo install cargo-udeps\n```\n\n### Crates.ioから\n\n```console\n❯ cargo install cargo-equip\n```\n\n### `master`ブランチから\n\n```console\n❯ cargo install cargo-equip --git https://github.com/qryxip/cargo-equip\n```\n\n### GitHub Releases\n\n[バイナリでの提供](https://github.com/qryxip/cargo-equip/releases)もしています。\n\n## 使い方\n\n`cargo-equip`で展開できるライブラリには以下の制約があります。\n\n1. `edition`は`\"2018\"`にする。\n\n    `\"2015\"`はサポートしません。\n\n2. `lib`クレートからは手続き型マクロを利用しない。\n\n    `lib`クレートからの手続き型マクロの利用は今のところサポートしていません。`pub use`することは問題ありません。\n\n3. `#[macro_export]`しないマクロの中では`crate`ではなく`$crate`を使う。\n\n    `macro_rules!`内の`$crate`は`$crate::extern_crate_name_in_main_crate`に置き換えられます。\n    `macro_rules!`内の`crate`は置き換えられません。\n\n4. 3.以外の場合も可能な限り絶対パスを使わない。\n\n    cargo-equipはpathの`crate`は`crate::extern_crate_name_in_main_crate`に、`pub(crate)`は`pub(in crate::extern_crate_name_in_main_crate)`に置き換えます。\n\n    ただしこの置き換えは必ず上手くいくかどうかがわかりません。\n    できる限り`crate::`よりも`self::`と`super::`を使ってください。\n\n    ```diff\n    -use crate::foo::Foo;\n    +use super::foo::Foo;\n    ```\n\n5. 可能な限り[glob import](https://doc.rust-lang.org/book/ch07-04-bringing-paths-into-scope-with-the-use-keyword.html#the-glob-operator)を使わない。\n\n    cargo-equipは[extern prelude](https://doc.rust-lang.org/reference/names/preludes.html#extern-prelude)や[`#[macro_use]`](https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute)を再現するためにglob importを挿入します。\n    glob importを使うとこれと衝突する可能性があります。\n\n6. 可能な限りライブラリを小さなクレートに分割する。\n\n    cargo-equipは「クレート内のアイテムの依存関係」を調べることはしません。\n    AtCoder以外に参加する場合は、出力結果を制限内(たいてい64KiB程度)に収めるためにできるだけ小さなクレートに分割してください。\n\n    ```console\n    .\n    ├── a\n    │   ├── Cargo.toml\n    │   └── src\n    │       └── lib.rs\n    ├── b\n    │   ├── Cargo.toml\n    │   └── src\n    │       └── lib.rs\n    ⋮\n    ```\n\nライブラリが用意できたら、それらを`bin`/`example`側の`Cargo.toml`の`[dependencies]`に加えてください。\nコンテスト毎にツールでパッケージを自動生成しているならそれのテンプレートに加えてください。\n\n[rust-lang-ja/ac-library-rs](https://github.com/rust-lang-ja/ac-library-rs)を使いたい場合、[qryxip/ac-library-rs-parted](https://github.com/qryxip/ac-library-rs-parted)を使ってください。\n本物のac-library-rsを加工したクレートです。\n\n```toml\n[dependencies]\nac-library-rs-parted             = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-convolution = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-dsu         = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-fenwicktree = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-lazysegtree = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-math        = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-maxflow     = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-mincostflow = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-modint      = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-scc         = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-segtree     = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-string      = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\nac-library-rs-parted-twosat      = { git = \"https://github.com/qryxip/ac-library-rs-parted\" }\n```\n\n準備ができたらコードを書いてください。\n`bin`/`example`側の制約は以下の2つです。\n\n1. 手続き型マクロを利用する場合、マクロ名が被らないように`proc-macro`クレートを選択する。\n\n    Rustのモジュールグラフを解析することは困難極まるため、手続き型マクロについてはプレフィックス抜きのマクロ名のみを頼りに展開します。\n    `proc-macro`クレートの跡地にはダミーのアイテムを展開するため、通常のプログラミングのように手続き型マクロを`use`しても問題はありません。\n\n    もし`use`することで問題が起きるなら、`#[macro_use] extern crate crate_name as _;`でインポートすることで、\n    これは`use crate::crate_name::__macros::*;`に置き換えられます。\n\n    cargo-equipは[extern prelude](https://doc.rust-lang.org/reference/names/preludes.html#extern-prelude)や[`#[macro_use]`](https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute)を再現するためにglob importを挿入します。\n    glob importを使うとこれと衝突する可能性があります。\n\n2. 可能な限りglob importを使わない。\n\n    ライブラリ同様にglob importを挿入します。\n\n    ```rust\n    pub use __cargo_equip::prelude::*;\n\n    // ︙\n\n    pub mod __cargo_equip {\n        pub mod crates {\n            // ︙\n        }\n        // ︙\n\n        pub(crate) prelude {\n            pub use crate::__cargo_equip::crates::*;\n        }\n    }\n    ```\n\n```rust\nuse input::input;\nuse mic::answer;\nuse partition_point::RangeBoundsExt as _;\n\n#[answer(join(\"\\n\"))]\nfn main() -\u003e _ {\n    input! {\n        a: [u64],\n    }\n    a.into_iter()\n        .map(|a| (1u64..1_000_000_000).partition_point(|ans| ans.pow(2) \u003c a))\n}\n```\n\nコードが書けたら`cargo equip`で展開します。\n`--bin {binの名前}`か`--example {exampleの名前}`、または`--src {binのファイルパス}`で`bin`/`example`を指定してください。\nパッケージ内の`bin`/`example`が一つの場合は省略できます。\nただし`default-run`には未対応です。\n\n```console\n❯ cargo equip --bin \"$name\"\n```\n\n\u003c!--\nコードはこのように展開されます。\n`extern_crate_name`が`bin`/`example`側から与えられていないクレートは`__package_name_0_1_0`のような名前が与えられます。\n\n```rust\n//! # Bundled libraries\n//!\n//! - `mic 0.0.0 (path+███████████████████████████████████████████)`                                                                                      published in https://github.com/qryxip/mic licensed under `CC0-1.0` as `crate::__cargo_equip::crates::mic`\n//! - `qryxip-competitive-input 0.0.0 (git+https://github.com/qryxip/competitive-programming-library#dadeb6e4685a86f25b4e5c8079f56337321aa12e)`                                                      licensed under `CC0-1.0` as `crate::__cargo_equip::crates::input`\n//! - `qryxip-competitive-partition-point 0.0.0 (git+https://github.com/qryxip/competitive-programming-library#dadeb6e4685a86f25b4e5c8079f56337321aa12e)`                                            licensed under `CC0-1.0` as `crate::__cargo_equip::crates::partition_point`\n//!\n//! # Procedural macros\n//!\n//! - `mic_impl 0.0.0 (path+████████████████████████████████████████████████████)` published in https://github.com/qryxip/mic licensed under `CC0-1.0`\n\npub use __cargo_equip::prelude::*;\n\nuse input::input;\n#[allow(unused_imports)]\nuse mic::answer;\nuse partition_point::RangeBoundsExt as _;\n\n/*#[answer(join(\"\\n\"))]\nfn main() -\u003e _ {\n    input! {\n        a: [u64],\n    }\n    a.into_iter()\n        .map(|a| (1u64..1_000_000_000).partition_point(|ans| ans.pow(2) \u003c a))\n}*/\nfn main() {\n    #[allow(unused_imports)]\n    use crate::__cargo_equip::crates::mic::__YouCannotRecurseIfTheOutputTypeIsInferred as main;\n    let __mic_ans = (move || -\u003e _ {\n        input! {a:[u64],}\n        a.into_iter()\n            .map(|a| (1u64..1_000_000_000).partition_point(|ans| ans.pow(2) \u003c a))\n    })();\n    let __mic_ans = {#[allow(unused_imports)]use/*::*/crate::__cargo_equip::crates::mic::functions::*;join(\"\\n\")(__mic_ans)};\n    ::std::println!(\"{}\", __mic_ans);\n}\n\n// The following code was expanded by `cargo-equip`.\n\n#[allow(unused)]\nmod __cargo_equip {\n    pub(crate) mod crates {\n        pub mod mic {\n            use crate::__cargo_equip::preludes::mic::*;\n            // ︙\n        }\n\n        pub mod __mic_impl_0_0_0 {\n            pub use crate::__cargo_equip::macros::__mic_impl_0_0_0::*;\n        }\n\n        pub mod input {\n            pub use crate::__cargo_equip::macros::input::*;\n            // ︙\n        }\n\n        pub mod partition_point {\n            // ︙\n        }\n    }\n\n    pub(crate) mod macros {\n        pub mod mic {}\n\n        pub mod __mic_impl_0_0_0 {\n            pub use crate::{\n                __macro_def___mic_impl_0_0_0_answer as answer,\n                __macro_def___mic_impl_0_0_0_solve as solve,\n            };\n        }\n\n        pub mod input {\n            pub use crate::{\n                __macro_def_input___input_inner as __input_inner,\n                __macro_def_input___read as __read, __macro_def_input_input as input,\n            };\n        }\n\n        pub mod partition_point {}\n    }\n\n    pub(crate) mod prelude {\n        pub use crate::__cargo_equip::crates::*;\n    }\n\n    mod preludes {\n        pub mod mic {\n            pub(in crate::__cargo_equip) use crate::__cargo_equip::crates::__mic_impl_0_0_0 as mic_impl;\n        }\n\n        pub mod __mic_impl_0_0_0 {}\n\n        pub mod input {}\n\n        pub mod partition_point {}\n    }\n}\n\n#[cfg_attr(any(), rustfmt::skip)]\nconst _: () = {\n    #[macro_export] macro_rules! __macro_def___mic_impl_0_0_0_answer(/* … */);\n    #[macro_export] macro_rules! __macro_def___mic_impl_0_0_0_solve(/* … */);\n    #[macro_export] macro_rules! __macro_def_input___input_inner(/* … */);\n    #[macro_export] macro_rules! __macro_def_input___read(/* … */);\n    #[macro_export] macro_rules! __macro_def_input_input(/* … */);\n};\n```\n--\u003e\n\n## `#[cfg(…)]`の解決\n\ncargo-equipはデフォルトで\n\n1. `#[cfg(恒真)]` (e.g. `cfg(feature = \"enabled-feature\")`)のアトリビュートを消去します。\n2. `#[cfg(恒偽)]` (e.g. `cfg(test)`, `cfg(feature = \"disable-feature\")`)のアトリビュートが付いたアイテムを消去します。\n\nこれは次の割り当てで判定されます。\n\n- [`test`](https://doc.rust-lang.org/reference/conditional-compilation.html#test): `false`\n- [`proc_macro`](https://doc.rust-lang.org/reference/conditional-compilation.html#proc_macro): `false`\n- `cargo_equip`: `true`\n- [`feature`](https://doc.rust-lang.org/cargo/reference/features.html): `bin`/`example`側から見て有効化されているもののみ`true`\n- それ以外: 不明\n\n```rust\n#[allow(dead_code)]\npub mod a {\n    pub struct A;\n\n    #[cfg(test)]\n    mod tests {\n        #[test]\n        fn it_works() {\n            assert_eq!(2 + 2, 4);\n        }\n    }\n}\n```\n\n↓\n\n```rust\n#[allow(dead_code)]\npub mod a {\n    pub struct A;\n}\n```\n\n## 出力を`cargo check`\n\ncargo-equipはデフォルトでバンドルしたコードを出力する前にtarget directoryを共有した一時パッケージを作り、それの上で`cargo check`します。\n\n```console\n    Checking cargo-equip-check-output-6j2i3j3tgtugeaqm v0.1.0 (/tmp/cargo-equip-check-output-6j2i3j3tgtugeaqm)\n    Finished dev [unoptimized + debuginfo] target(s) in 0.11s\n```\n\n## 手続き型マクロの展開\n\ncargo-equipは手続き型マクロを展開する機能を持っています。\n\n```rust\nuse memoise::memoise;\nuse proconio_derive::fastout;\n\n#[fastout]\nfn main() {\n    for i in 0..=10 {\n        println!(\"{}\", fib(i));\n    }\n}\n\n#[memoise(n \u003c= 10)]\nfn fib(n: i64) -\u003e i64 {\n    if n == 0 || n == 1 {\n        return n;\n    }\n    fib(n - 1) + fib(n - 2)\n}\n```\n\n\u003c!--\n↓\n\n\u003cdetails\u003e\n\u003csummary\u003eOutput\u003c/summary\u003e\n\n```rust\n//! # Procedural macros\n//!\n//! - `memoise 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)`         licensed under `BSD-3-Clause`\n//! - `proconio-derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)` licensed under `MIT OR Apache-2.0`\n\npub use __cargo_equip::prelude::*;\n\n#[allow(unused_imports)]\nuse memoise::memoise;\n#[allow(unused_imports)]\nuse proconio_derive::fastout;\n\n/*#[fastout]\nfn main() {\n    for i in 0..=10 {\n        println!(\"{}\", fib(i));\n    }\n}*/\nfn main() {\n    let __proconio_stdout = ::std::io::stdout();\n    let mut __proconio_stdout = ::std::io::BufWriter::new(__proconio_stdout.lock());\n    #[allow(unused_macros)]\n    macro_rules!print{($($tt:tt)*)=\u003e{{use std::io::Write as _;::std::write!(__proconio_stdout,$($tt)*).unwrap();}};}\n    #[allow(unused_macros)]\n    macro_rules!println{($($tt:tt)*)=\u003e{{use std::io::Write as _;::std::writeln!(__proconio_stdout,$($tt)*).unwrap();}};}\n    let __proconio_res = {\n        for i in 0..=10 {\n            println!(\"{}\", fib(i));\n        }\n    };\n    \u003c::std::io::BufWriter\u003c::std::io::StdoutLock\u003e as ::std::io::Write\u003e::flush(\n        \u0026mut __proconio_stdout,\n    )\n    .unwrap();\n    return __proconio_res;\n}\n\n/*#[memoise(n \u003c= 10)]\nfn fib(n: i64) -\u003e i64 {\n    if n == 0 || n == 1 {\n        return n;\n    }\n    fib(n - 1) + fib(n - 2)\n}*/\nthread_local!(static FIB:std::cell::RefCell\u003cVec\u003cOption\u003ci64\u003e \u003e \u003e =std::cell::RefCell::new(vec![None;11usize]));\nfn fib_reset() {\n    FIB.with(|cache| {\n        let mut r = cache.borrow_mut();\n        for r in r.iter_mut() {\n            *r = None\n        }\n    });\n}\nfn fib(n: i64) -\u003e i64 {\n    if let Some(ret) = FIB.with(|cache| {\n        let mut bm = cache.borrow_mut();\n        bm[(n) as usize].clone()\n    }) {\n        return ret;\n    }\n    let ret: i64 = (|| {\n        if n == 0 || n == 1 {\n            return n;\n        }\n        fib(n - 1) + fib(n - 2)\n    })();\n    FIB.with(|cache| {\n        let mut bm = cache.borrow_mut();\n        bm[(n) as usize] = Some(ret.clone());\n    });\n    ret\n}\n\n// The following code was expanded by `cargo-equip`.\n\n#[allow(unused)]\nmod __cargo_equip {\n    pub(crate) mod crates {\n        pub mod memoise {\n            pub use crate::__cargo_equip::macros::memoise::*;\n        }\n\n        pub mod proconio_derive {\n            pub use crate::__cargo_equip::macros::proconio_derive::*;\n        }\n    }\n\n    pub(crate) mod macros {\n        pub mod memoise {\n            pub use crate::{\n                __macro_def_memoise_memoise as memoise,\n                __macro_def_memoise_memoise_map as memoise_map,\n            };\n        }\n\n        pub mod proconio_derive {\n            pub use crate::{\n                __macro_def_proconio_derive_derive_readable as derive_readable,\n                __macro_def_proconio_derive_fastout as fastout,\n            };\n        }\n    }\n\n    pub(crate) mod prelude {\n        pub use crate::__cargo_equip::crates::*;\n    }\n\n    mod preludes {\n        pub mod memoise {}\n\n        pub mod proconio_derive {}\n    }\n}\n\n#[cfg_attr(any(), rustfmt::skip)]\nconst _: () = {\n    #[macro_export] macro_rules! __macro_def_memoise_memoise(($(_:tt)*)=\u003e(::std::compile_error!(\"`memoise` from `memoise 0.3.2` should have been expanded\");));\n    #[macro_export] macro_rules! __macro_def_memoise_memoise_map(($(_:tt)*)=\u003e(::std::compile_error!(\"`memoise_map` from `memoise 0.3.2` should have been expanded\");));\n    #[macro_export] macro_rules! __macro_def_proconio_derive_derive_readable(($(_:tt)*)=\u003e(::std::compile_error!(\"`derive_readable` from `proconio-derive 0.2.1` should have been expanded\");));\n    #[macro_export] macro_rules! __macro_def_proconio_derive_fastout(($(_:tt)*)=\u003e(::std::compile_error!(\"`fastout` from `proconio-derive 0.2.1` should have been expanded\");));\n};\n```\n\n\u003c/details\u003e\n--\u003e\n\n- `proc-macro`クレートは1.48.0以上のRustでコンパイルされる必要があります。\n   現在のツールチェインが1.48.0未満である場合、1.48.0以上のツールチェインを探してそれでコンパイルします。\n- `pub use $name::*;`でre-exportedされた手続き型マクロも展開することができます。\n\n## オプション\n\n### `--remove \u003cREMOVE\u003e...`\n\n1. `--remove docs`でDoc comment (`//! ..`, `/// ..`, `/** .. */`, `#[doc = \"..\"]`)を\n2. `--remove comments`でコメント (`// ..`, `/* .. */`)を\n\n除去します。\n\n```rust\n#[allow(dead_code)]\npub mod a {\n    //! A.\n\n    /// A.\n    pub struct A; // aaaaa\n}\n```\n\n↓\n\n```rust\n#[allow(dead_code)]\npub mod a {\n    pub struct A;\n}\n```\n\n### `--minify \u003cMINIFY\u003e`\n\n`--minify lib`で展開後のライブラリをそれぞれ一行に折り畳みます。\n`--minify all`でコード全体を最小化します。\n\nただ現段階では実装が適当なのでいくつか余計なスペースが挟まる場合があります。\n\n### `--no-resolve-cfgs`\n\n`#[cfg(…)]`を解決しません。\n\n### `--no-rustfmt`\n\n出力をRustfmtでフォーマットするのをスキップします。\n\n### `--no-check`\n\n出力を`cargo check`にかけるのをスキップします。\n\n## ライセンス\n\n[MIT](https://opensource.org/licenses/MIT) or [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)のデュアルライセンスです。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqryxip%2Fcargo-equip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqryxip%2Fcargo-equip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqryxip%2Fcargo-equip/lists"}