Skip to content

Commit 79d7564

Browse files
authored
Bug 1989584 - split out nimbus examples to new crate (#6980)
- Moved `components/nimbus/examples/` => `examples/nimbus/` so that it lives with the other examples. - Set the Rust edition in the nimbus `Cargo.toml`.
1 parent 1c1c4da commit 79d7564

File tree

6 files changed

+24
-16
lines changed

6 files changed

+24
-16
lines changed

Cargo.lock

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/nimbus/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ uniffi = { version = "0.29.0", features = ["build"] }
4646

4747
[dev-dependencies]
4848
error-support = { path = "../support/error", features = ["testing"] }
49-
viaduct-hyper = { path = "../support/viaduct-hyper" }
5049
clap = { version = "4.2", default-features = false, features = ["std", "derive"] }
5150
tempfile = "3"
5251
ctor = "0.2.2"

examples/nimbus/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "examples-nimbus-experiment"
3+
edition = "2021"
4+
5+
[dependencies]
6+
nimbus-sdk = { path = "../../components/nimbus/", features = ["stateful"] }
7+
serde_json = "1"
8+
uuid = { version = "1.3", features = ["serde", "v4"]}
9+
error-support = { path = "../../components/support/error", features = ["testing", "tracing-logging"] }
10+
viaduct-hyper = { path = "../../components/support/viaduct-hyper" }
11+
clap = { version = "4.2", default-features = false, features = ["std", "derive"] }
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
# Experiments CLI
22
In this directory we have a command line interface that helps us interact with the Nimbus SDK.
33

4-
54
## How to use
65
In order to use the CLI, you would run it as an example:
76
```bash
8-
cargo run --example experiment -- -c ./examples/config/config.json show-experiments
7+
cargo run -p examples-nimbus-experiment -- -c ./config/config.json show-experiments
98
```
109
This would display all the valid experiments retrieved from the server
1110

12-
You can check out the details by running
13-
```bash
14-
cargo run --example experiment -- -h
15-
```
16-
1711
You can set a config file using the `-c` option, which can include the following:
1812

1913
```text
File renamed without changes.
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use clap::{Parser, Subcommand};
66
use std::path::PathBuf;
77

8-
#[allow(unused_imports)] // may be unused in some features.
98
use nimbus::error::{info, Result};
109

1110
#[derive(Parser)]
@@ -92,7 +91,6 @@ enum Subcommands {
9291
},
9392
}
9493

95-
#[cfg(feature = "stateful")]
9694
fn main() -> Result<()> {
9795
const DEFAULT_BASE_URL: &str = "https://firefox.settings.services.mozilla.com";
9896
const DEFAULT_COLLECTION_NAME: &str = "messaging-experiments";
@@ -361,8 +359,3 @@ fn main() -> Result<()> {
361359
};
362360
Ok(())
363361
}
364-
365-
#[cfg(not(feature = "stateful"))]
366-
fn main() -> Result<()> {
367-
Ok(())
368-
}

0 commit comments

Comments
 (0)