Skip to content

Commit

Permalink
rename "examples" to "demos" to avoid confusion with Cargo examples
Browse files Browse the repository at this point in the history
I got confused because I tried to run the player with:

cargo run --examples demo_player

However this did not work because demo_player is structured as a
subcrate in a workspace, not as an example. Cargo examples do not
have a src directory nor their own Cargo.toml:
https://doc.rust-lang.org/cargo/guide/project-layout.html

Unfortunately there is no way to specify dependencies only for an
example. There is an open RFC for that:
rust-lang/rfcs#2887

So for now, I think it is best to leave the demo applications as
subcrates in a workspace, but rename the "examples" directory to
"demos" so people don't think they will work with
cargo run --examples
  • Loading branch information
Be-ing authored and obsoleszenz committed Apr 17, 2022
1 parent 38d00bd commit 9e60a04
Show file tree
Hide file tree
Showing 15 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ members = [
"core",
"decode_wav",
"encode_wav",
"examples/demo_player",
"examples/demo_writer",
"demos/player",
"demos/writer",
]

[features]
Expand Down
4 changes: 2 additions & 2 deletions examples/demo_player/Cargo.toml → demos/player/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "demo_player"
name = "player"
version = "0.1.0"
authors = ["Billy Messenger <[email protected]>"]
edition = "2018"
Expand All @@ -11,4 +11,4 @@ publish = false
creek = { path = "../../" }
eframe = "0.9.0"
rtrb = "0.2"
cpal = "0.13"
cpal = "0.13"
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/demo_writer/Cargo.toml → demos/writer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "demo_writer"
name = "writer"
version = "0.1.0"
authors = ["Billy Messenger <[email protected]>"]
edition = "2018"
Expand All @@ -11,4 +11,4 @@ publish = false
creek = { path = "../../" }
eframe = "0.9.0"
rtrb = "0.2"
cpal = "0.13"
cpal = "0.13"
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9e60a04

Please sign in to comment.