diff --git a/CHANGELOG.md b/CHANGELOG.md index a7803ba..2b16d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.1] + +### Documentation + +- The crate-level example is now a compile-tested doctest instead of `ignore`, + so it is verified against the public API on every build. + ## [0.1.0] Initial release of `beckon`. diff --git a/Cargo.lock b/Cargo.lock index 13c4066..17809ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,7 +41,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "beckon" -version = "0.1.0" +version = "0.1.1" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 17b308d..a3310ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "beckon" -version = "0.1.0" +version = "0.1.1" edition = "2021" authors = ["Azeem Shaik "] description = "Generate type-safe, async HTTP clients from endpoint definitions — a Rust proc macro." diff --git a/src/lib.rs b/src/lib.rs index c7f9365..d23447b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,19 +4,19 @@ //! with one async method per endpoint, a matching trait for mocking, and a typed //! error enum. //! -//! ```ignore +//! ``` //! use beckon::beckon; //! use serde::{Deserialize, Serialize}; //! //! #[derive(Serialize, Deserialize)] -//! struct User { -//! id: u32, -//! name: String, +//! pub struct User { +//! pub id: u32, +//! pub name: String, //! } //! //! #[derive(Serialize)] -//! struct UserPath { -//! id: u32, +//! pub struct UserPath { +//! pub id: u32, //! } //! //! beckon!( @@ -36,9 +36,13 @@ //! } //! ); //! -//! // let client = UserApi::new(reqwest::Url::parse("https://api.example.com")?, Some(30)); -//! // let users = client.get_users().await?; -//! // let user = client.get_users_by_id(&UserPath { id: 1 }).await?; +//! # async fn example() -> Result<(), Box> { +//! let client = UserApi::new(reqwest::Url::parse("https://api.example.com")?, Some(30)); +//! let _users = client.get_users().await?; +//! let _user = client.get_users_by_id(&UserPath { id: 1 }).await?; +//! # Ok(()) +//! # } +//! # fn main() {} //! ``` extern crate proc_macro;