Skip to content

Commit 9c023bf

Browse files
authored
docs(iroh): Use iroh::Watcher reexport in docs (#3375)
## Description Fixes the documentation examples to avoid `n0_watcher` imports in favor of just `iroh::Watcher`. ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant.
1 parent eb383a6 commit 9c023bf

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

iroh/src/endpoint.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,7 @@ impl Endpoint {
912912
///
913913
/// ```no_run
914914
/// # async fn wrapper() -> n0_snafu::Result {
915-
/// use iroh::Endpoint;
916-
/// use n0_watcher::Watcher;
915+
/// use iroh::{Endpoint, Watcher};
917916
///
918917
/// let endpoint = Endpoint::builder()
919918
/// .alpns(vec![b"my-alpn".to_vec()])
@@ -982,9 +981,7 @@ impl Endpoint {
982981
///
983982
/// To wait for a home relay connection to be established, use [`Watcher::initialized`]:
984983
/// ```no_run
985-
/// use iroh::Endpoint;
986-
/// use n0_future::StreamExt;
987-
/// use n0_watcher::Watcher as _;
984+
/// use iroh::{Endpoint, Watcher};
988985
///
989986
/// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
990987
/// # rt.block_on(async move {
@@ -1019,14 +1016,12 @@ impl Endpoint {
10191016
///
10201017
/// To get the first set of direct addresses use [`Watcher::initialized`]:
10211018
/// ```no_run
1022-
/// use iroh::Endpoint;
1023-
/// use n0_future::StreamExt;
1024-
/// use n0_watcher::Watcher as _;
1019+
/// use iroh::{Endpoint, Watcher as _};
10251020
///
10261021
/// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
10271022
/// # rt.block_on(async move {
1028-
/// let mep = Endpoint::builder().bind().await.unwrap();
1029-
/// let _addrs = mep.direct_addresses().initialized().await.unwrap();
1023+
/// let ep = Endpoint::builder().bind().await.unwrap();
1024+
/// let _addrs = ep.direct_addresses().initialized().await.unwrap();
10301025
/// # });
10311026
/// ```
10321027
///
@@ -1055,9 +1050,7 @@ impl Endpoint {
10551050
///
10561051
/// To get the first report use [`Watcher::initialized`]:
10571052
/// ```no_run
1058-
/// use iroh::Endpoint;
1059-
/// use n0_future::StreamExt;
1060-
/// use n0_watcher::Watcher as _;
1053+
/// use iroh::{Endpoint, Watcher as _};
10611054
///
10621055
/// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
10631056
/// # rt.block_on(async move {

0 commit comments

Comments
 (0)