Skip to content

Commit

Permalink
docs: example requires example feature to run (#2451)
Browse files Browse the repository at this point in the history
## Description

You will get this error without passing `--features=examples`.

```bash
🐡 ❯ cargo run --example client
error: target `client` in package `iroh` requires the features: `examples`
Consider enabling them by passing, e.g., `--features="examples"
```

## Breaking Changes

No.

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.


Closes #2431
  • Loading branch information
azzamsa authored Jul 3, 2024
1 parent 5ba6855 commit 623dcc6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion iroh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ iroh = { version = "...", default-features = false }

## Running Examples

Examples are located in `iroh/examples`. Run them with `cargo run --example`. eg: `cargo run --example hello-world`. At the top of each example file is a comment describing how to run the example.
Examples are located in `iroh/examples`. Run them with `cargo run --features=examples --example`. eg: `cargo run --features=examples --example hello-world`. At the top of each example file is a comment describing how to run the example.

# License

Expand Down
2 changes: 1 addition & 1 deletion iroh/examples/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! The iroh node that creates the document is backed by an in-memory database and a random node ID
//!
//! run this example from the project root:
//! $ cargo run --example client
//! $ cargo run --features=examples --example client
use indicatif::HumanBytes;
use iroh::{base::base32, client::docs::Entry, docs::store::Query, node::Node};
use tokio_stream::StreamExt;
Expand Down
2 changes: 1 addition & 1 deletion iroh/examples/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! An example that runs an iroh node that can be controlled via RPC.
//!
//! Run this example with
//! $ cargo run --example rpc
//! $ cargo run --features=examples --example rpc
//! Then in another terminal, run any of the normal iroh CLI commands, which you can run from
//! cargo as well:
//! $ cargo run node stats
Expand Down

0 comments on commit 623dcc6

Please sign in to comment.