From dba4ba0df4ca86bd188f208fb2c7411a5b4d14e8 Mon Sep 17 00:00:00 2001 From: G2-Games Date: Wed, 19 Jun 2024 16:40:32 -0500 Subject: [PATCH] Fixed doc failure --- Cargo.toml | 3 +++ src/lib.rs | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 42c1506..bcce35d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,9 @@ targets = [ [lib] crate-type = ["cdylib", "rlib"] +[dev-dependencies] +tokio-test = "0.4.3" + [dependencies] diacritics = "0.2.0" encoding_rs = "0.8.33" diff --git a/src/lib.rs b/src/lib.rs index 5923f4b..beba9d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,22 +7,24 @@ //! To use this library, first you need to get a device from [`cross_usb`] and //! then open a [`NetMDContext`]. //! -//! ```rust -//! use cross_usb::prelude::get_device; +//! ```no_run +//! # tokio_test::block_on(async { +//! use cross_usb::get_device; //! use minidisc::netmd::base::DEVICE_IDS_CROSSUSB; //! use minidisc::NetMDContext; //! //! // Get a device using the built-in list of descriptors for minidisc devices -//! let dev_descriptor = cross_usb::get_device(DEVICE_IDS_CROSSUSB).await +//! let dev_descriptor = cross_usb::get_device(DEVICE_IDS_CROSSUSB.to_vec()).await //! .expect("Failed to find device"); //! //! // Open a NetMD Context with the device -//! let context = NetMDContext::new(dev_descriptor).await +//! let mut context = NetMDContext::new(dev_descriptor).await //! .expect("Could not create context"); //! //! // Perform operations on it ... //! context.list_content().await //! .expect("Could not list disc contents"); +//! # }) //! ``` pub mod netmd;