mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-14 16:35:01 +01:00
lol
This commit is contained in:
commit
a2bc92d651
10 changed files with 1548 additions and 0 deletions
30
src/lib.rs
Normal file
30
src/lib.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
use std::path::Path;
|
||||
|
||||
mod build;
|
||||
mod expand;
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
|
||||
pub fn minimize(cargo_dir: &Path) -> Result<()> {
|
||||
let file = expand::expand(cargo_dir).context("during expansion")?;
|
||||
|
||||
|
||||
let file = prettyplease::unparse(&file);
|
||||
|
||||
println!("// EXPANDED-START\n\n{file}\n\n// EXPANDED-END");
|
||||
|
||||
std::fs::write("expanded.rs", file)?;
|
||||
|
||||
println!("wow, expanded");
|
||||
Ok(())
|
||||
|
||||
/*
|
||||
let build = Build::new(cargo_dir);
|
||||
|
||||
if build.build()?.success {
|
||||
bail!("build must initially fail!");
|
||||
}
|
||||
*/
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue