summaryrefslogtreecommitdiff
path: root/src/cargo/internal.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2024-08-17 00:14:10 +0200
committerfxqnlr <[email protected]>2024-08-17 00:14:10 +0200
commit137346307248bc9e327847e549c3d6c24b3b11f3 (patch)
tree94d73000aa881c912f93eccbfb9e0d0a7c5857ea /src/cargo/internal.rs
parent371a77a994aeb0beae53f24a0edbf99d70133c33 (diff)
downloadrsrclean-main.tar
rsrclean-main.tar.gz
rsrclean-main.zip
add external cargoHEADmain
Diffstat (limited to 'src/cargo/internal.rs')
-rw-r--r--src/cargo/internal.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cargo/internal.rs b/src/cargo/internal.rs
new file mode 100644
index 0000000..b3e44e4
--- /dev/null
+++ b/src/cargo/internal.rs
@@ -0,0 +1,28 @@
1use std::path::Path;
2
3use cargo::{
4 core::Workspace,
5 ops::{clean, CleanOptions},
6 util::{context::GlobalContext, interning::InternedString},
7 CargoResult,
8};
9
10use crate::cli::Args;
11
12pub fn clean_int(path: &Path, cli: &Args) -> CargoResult<()> {
13 let gctx = GlobalContext::default()?;
14
15 let workspace = Workspace::new(path, &gctx)?;
16
17 let opts = CleanOptions {
18 gctx: &gctx,
19 spec: vec![],
20 targets: vec![],
21 profile_specified: false,
22 requested_profile: InternedString::new("dev"),
23 doc: cli.doc,
24 dry_run: cli.dry_run,
25 };
26
27 clean(&workspace, &opts)
28}