From 5ea245badfa7fc01fd7ecd95aea16cd8a10cd170 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Sun, 6 Nov 2022 20:39:27 +0100 Subject: [PATCH] Make example binaries proper cargo examples (#7019) Should not be built by default with `cargo build` Instead are compiled with `cargo test` to avoid bitrot Run with `cargo run -p ... --example ...` --- crates/nu-system/Cargo.toml | 4 ---- crates/nu-system/{src/main.rs => examples/demo.rs} | 0 crates/nu-table/Cargo.toml | 5 ----- crates/nu-table/{src/main.rs => examples/demo.rs} | 0 crates/nu-term-grid/Cargo.toml | 5 ----- crates/nu-term-grid/{src/main.rs => examples/grid.rs} | 0 6 files changed, 14 deletions(-) rename crates/nu-system/{src/main.rs => examples/demo.rs} (100%) rename crates/nu-table/{src/main.rs => examples/demo.rs} (100%) rename crates/nu-term-grid/{src/main.rs => examples/grid.rs} (100%) diff --git a/crates/nu-system/Cargo.toml b/crates/nu-system/Cargo.toml index 8c4d261a8b..72981230a9 100644 --- a/crates/nu-system/Cargo.toml +++ b/crates/nu-system/Cargo.toml @@ -9,10 +9,6 @@ license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[[bin]] -name = "ps" -path = "src/main.rs" - [dependencies] libc = "0.2" log = "0.4" diff --git a/crates/nu-system/src/main.rs b/crates/nu-system/examples/demo.rs similarity index 100% rename from crates/nu-system/src/main.rs rename to crates/nu-system/examples/demo.rs diff --git a/crates/nu-table/Cargo.toml b/crates/nu-table/Cargo.toml index a3c1ca6b3b..0f6bc0e23b 100644 --- a/crates/nu-table/Cargo.toml +++ b/crates/nu-table/Cargo.toml @@ -7,11 +7,6 @@ license = "MIT" name = "nu-table" version = "0.70.1" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[[bin]] -name = "table" -path = "src/main.rs" - [dependencies] nu-ansi-term = "0.46.0" nu-protocol = { path = "../nu-protocol", version = "0.70.1" } diff --git a/crates/nu-table/src/main.rs b/crates/nu-table/examples/demo.rs similarity index 100% rename from crates/nu-table/src/main.rs rename to crates/nu-table/examples/demo.rs diff --git a/crates/nu-term-grid/Cargo.toml b/crates/nu-term-grid/Cargo.toml index 19113e3f0e..f90b344d2a 100644 --- a/crates/nu-term-grid/Cargo.toml +++ b/crates/nu-term-grid/Cargo.toml @@ -7,11 +7,6 @@ license = "MIT" name = "nu-term-grid" version = "0.70.1" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[[bin]] -name = "grid" -path = "src/main.rs" - [dependencies] unicode-width = "0.1.9" diff --git a/crates/nu-term-grid/src/main.rs b/crates/nu-term-grid/examples/grid.rs similarity index 100% rename from crates/nu-term-grid/src/main.rs rename to crates/nu-term-grid/examples/grid.rs