Skip to content

Commit

Permalink
Fix doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer committed Mar 29, 2024
1 parent a58c1b4 commit 395e64c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
//! # fn main() -> Result<(), tide_disco::api::ApiError> {
//! use tide_disco::Api;
//! use tide_disco::error::ServerError;
//! use versioned_binary_serialization::version::StaticVersion;
//! use vbs::version::StaticVersion;
//!
//! type State = ();
//! type Error = ServerError;
Expand All @@ -74,7 +74,7 @@
//!
//! ```no_run
//! # use tide_disco::Api;
//! # use versioned_binary_serialization::version::StaticVersion;
//! # use vbs::version::StaticVersion;
//! # type StaticVer01 = StaticVersion<0, 1>;
//! # fn main() -> Result<(), tide_disco::api::ApiError> {
//! # let spec: toml::Value = toml::from_str(std::str::from_utf8(&std::fs::read("/path/to/api.toml").unwrap()).unwrap()).unwrap();
Expand All @@ -92,22 +92,21 @@
//! an [App]:
//!
//! ```no_run
//! # use versioned_binary_serialization::version::StaticVersion;
//! # use vbs::version::StaticVersion;
//! # type State = ();
//! # type Error = tide_disco::error::ServerError;
//! # type StaticVer01 = StaticVersion<0, 1>;
//! # #[async_std::main] async fn main() {
//! # let spec: toml::Value = toml::from_str(std::str::from_utf8(&std::fs::read("/path/to/api.toml").unwrap()).unwrap()).unwrap();
//! # let api = tide_disco::Api::<State, Error, StaticVer01>::new(spec).unwrap();
//! use tide_disco::App;
//! use versioned_binary_serialization::version::StaticVersion;
//! use vbs::version::StaticVersion;
//!
//! type StaticVer01 = StaticVersion<0, 1>;
//! const VER_0_1: StaticVer01 = StaticVersion {};
//!
//! let mut app = App::<State, Error, StaticVer01>::with_state(());
//! app.register_module("api", api);
//! app.serve("http://localhost:8080", VER_0_1).await;
//! app.serve("http://localhost:8080").await;
//! # }
//! ```
//!
Expand Down Expand Up @@ -209,7 +208,7 @@
//! use async_std::sync::RwLock;
//! use futures::FutureExt;
//! use tide_disco::Api;
//! use versioned_binary_serialization::version::StaticVersion;
//! use vbs::version::StaticVersion;
//!
//! type State = RwLock<u64>;
//! type Error = ();
Expand All @@ -231,7 +230,7 @@
//! use async_std::sync::RwLock;
//! use futures::FutureExt;
//! use tide_disco::{Api, RequestParams};
//! use versioned_binary_serialization::version::StaticVersion;
//! use vbs::version::StaticVersion;
//!
//! type State = RwLock<u64>;
//! type Error = ();
Expand Down

0 comments on commit 395e64c

Please sign in to comment.