From e9c236a6821e221c485ccf478ae79fbc3fb3f7dd Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Tue, 10 Sep 2019 09:21:55 +0000 Subject: [PATCH 1/4] float_ord: Fix test --- src/float_ord.rs | 1 + src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/float_ord.rs b/src/float_ord.rs index c27ac5e9..ce562694 100644 --- a/src/float_ord.rs +++ b/src/float_ord.rs @@ -67,6 +67,7 @@ float_ord_impl!(f64, u64, 64); /// # Example /// /// ``` +/// use rs::float_ord; /// let mut v = [-5.0, 4.0, 1.0, -3.0, 2.0]; /// /// float_ord::sort(&mut v); diff --git a/src/lib.rs b/src/lib.rs index 3d755f12..ec18596c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ #[macro_use] extern crate bitflags; -mod float_ord; +pub mod float_ord; mod imservice; mod keyboard; mod layout; From ed8b6eec2887a568edb966d22804ffe003bdb641 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Tue, 10 Sep 2019 09:24:02 +0000 Subject: [PATCH 2/4] More float_ord docs --- src/float_ord.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/float_ord.rs b/src/float_ord.rs index ce562694..0c81217d 100644 --- a/src/float_ord.rs +++ b/src/float_ord.rs @@ -5,6 +5,10 @@ /* Adapted from https://github.com/notriddle/rust-float-ord revision e995165f * maintained by Michael Howell * licensed under MIT / Apache-2.0 licenses + * + * This version drops any dependency on rand. + * Caution: Don't pull the version from crates.io + * before making sure rand is optional. */ extern crate core; From 51562d5185dd55761db3a989b3492f50b7e208ae Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Tue, 10 Sep 2019 09:25:55 +0000 Subject: [PATCH 3/4] Fix imservice docstring --- src/imservice.rs | 3 ++- src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/imservice.rs b/src/imservice.rs index 5979f86d..691e14c2 100644 --- a/src/imservice.rs +++ b/src/imservice.rs @@ -230,7 +230,8 @@ bitflags!{ /// Map to `text_input_unstable_v3.content_purpose` values /// /// ``` -/// assert_eq!(ContentPurpose::Alpha as u32, 0); +/// use rs::imservice::ContentPurpose; +/// assert_eq!(ContentPurpose::Alpha as u32, 1); /// ``` #[derive(Debug, Clone)] pub enum ContentPurpose { diff --git a/src/lib.rs b/src/lib.rs index ec18596c..416ad577 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ extern crate bitflags; pub mod float_ord; -mod imservice; +pub mod imservice; mod keyboard; mod layout; mod symbol; From 0922d4a87afb0ea547e87a9416de9aa61fb5c8cb Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Tue, 10 Sep 2019 09:34:25 +0000 Subject: [PATCH 4/4] tests: Allow the building of doctests Also allows for standalone tests and examples to be built and run with Cargo. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fc5d8894..b6497064 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,4 +8,4 @@ bitflags = "1.1" [lib] name = "rs" path = "src/lib.rs" -crate-type = ["staticlib"] +crate-type = ["staticlib", "rlib"]