From 4c2288b7a3c07469994bd2e9d6a6f5c78844d330 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Fri, 3 Jul 2020 18:28:05 +0200 Subject: [PATCH 1/2] Avoid using unwrap in examples --- src/lib.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 359f61a..c9668b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -144,21 +144,24 @@ //! Turn on an LED for one second and *then* loops back serial data. //! //! ``` +//! use core::convert::Infallible; //! use nb::block; //! //! use hal::{Led, Serial, Timer}; //! +//! # fn main() -> Result<(), Infallible> { //! // Turn the LED on for one second //! Led.on(); -//! block!(Timer.wait()).unwrap(); // NOTE(unwrap) E = Infallible +//! block!(Timer.wait())?; //! Led.off(); //! //! // Serial interface loopback -//! # return; +//! # return Ok(()); //! loop { -//! let byte = block!(Serial.read()).unwrap(); -//! block!(Serial.write(byte)).unwrap(); +//! let byte = block!(Serial.read())?; +//! block!(Serial.write(byte))?; //! } +//! # } //! //! # mod hal { //! # use nb; @@ -170,8 +173,8 @@ //! # } //! # pub struct Serial; //! # impl Serial { -//! # pub fn read(&self) -> nb::Result { Ok(0) } -//! # pub fn write(&self, _: u8) -> nb::Result<(), ()> { Ok(()) } +//! # pub fn read(&self) -> nb::Result { Ok(0) } +//! # pub fn write(&self, _: u8) -> nb::Result<(), Infallible> { Ok(()) } //! # } //! # pub struct Timer; //! # impl Timer { From 56f6faa35d66927e54758c4d116f900cc6be5d76 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Tue, 7 Jul 2020 20:21:44 +0200 Subject: [PATCH 2/2] Prepare 1.0.0 release --- CHANGELOG.md | 5 ++++- Cargo.toml | 2 +- src/lib.rs | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0201b8..7c8ed8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [v1.0.0] - 2020-07-07 + ### Changed - [breaking-change] The `unstable` feature and its code has been removed. @@ -31,6 +33,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Initial release -[Unreleased]: https://github.com/rust-embedded/nb/compare/v0.1.2...HEAD +[Unreleased]: https://github.com/rust-embedded/nb/compare/v1.0.0...HEAD +[v1.0.0]: https://github.com/rust-embedded/nb/compare/v0.1.2...v1.0.0 [v0.1.2]: https://github.com/rust-embedded/nb/compare/v0.1.1...v0.1.2 [v0.1.1]: https://github.com/rust-embedded/nb/compare/v0.1.0...v0.1.1 diff --git a/Cargo.toml b/Cargo.toml index 88c6015..9805cce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,5 +9,5 @@ repository = "https://github.com/rust-embedded/nb" homepage = "https://github.com/rust-embedded/nb" documentation = "https://docs.rs/nb" readme = "README.md" -version = "0.1.2" +version = "1.0.0" # remember to update html_root_url edition = "2018" diff --git a/src/lib.rs b/src/lib.rs index c9668b1..fc2b516 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -184,6 +184,7 @@ //! ``` #![no_std] +#![doc(html_root_url = "https://docs.rs/nb/1.0.0")] use core::fmt;