From 1e13e6be5f8b92609eaae040c41ce6acf9da527c Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 3 Oct 2020 18:49:11 +0800 Subject: [PATCH] Doc formatting. --- src/engine.rs | 6 +++--- src/error.rs | 2 +- src/lib.rs | 10 ++++------ src/module/mod.rs | 2 +- src/parser.rs | 18 ++++++++++-------- src/token.rs | 10 +++++----- src/utils.rs | 4 ++-- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/engine.rs b/src/engine.rs index 77f4c1e3..9e12fe0d 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -60,7 +60,7 @@ pub type Array = Vec; #[cfg(not(feature = "no_object"))] pub type Map = HashMap; -/// [INTERNALS] A stack of imported modules. +/// _[INTERNALS]_ A stack of imported modules. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -289,7 +289,7 @@ impl> From for Target<'_> { } } -/// [INTERNALS] A type that holds all the current states of the Engine. +/// _[INTERNALS]_ A type that holds all the current states of the Engine. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -318,7 +318,7 @@ impl State { } } -/// [INTERNALS] A type containing all the limits imposed by the `Engine`. +/// _[INTERNALS]_ A type containing all the limits imposed by the `Engine`. /// Exported under the `internals` feature only. /// /// ## WARNING diff --git a/src/error.rs b/src/error.rs index 1d5ea7f8..2c210d60 100644 --- a/src/error.rs +++ b/src/error.rs @@ -10,7 +10,7 @@ use crate::stdlib::{ string::{String, ToString}, }; -/// [INTERNALS] Error encountered when tokenizing the script text. +/// _[INTERNALS]_ Error encountered when tokenizing the script text. /// Exported under the `internals` feature only. /// /// ## WARNING diff --git a/src/lib.rs b/src/lib.rs index 13536be4..f61af46c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -128,16 +128,14 @@ pub mod module_resolvers { pub use crate::module::resolvers::*; } -/// Serialization support for [`serde`](https://crates.io/crates/serde). -/// -/// Requires the `serde` feature. +/// _[SERDE]_ Serialization support for [`serde`](https://crates.io/crates/serde). +/// Exported under the `serde` feature. #[cfg(feature = "serde")] pub mod ser { pub use crate::serde::ser::to_dynamic; } -/// Deserialization support for [`serde`](https://crates.io/crates/serde). -/// -/// Requires the `serde` feature. +/// _[SERDE]_ Deserialization support for [`serde`](https://crates.io/crates/serde). +/// Exported under the `serde` feature. #[cfg(feature = "serde")] pub mod de { pub use crate::serde::de::from_dynamic; diff --git a/src/module/mod.rs b/src/module/mod.rs index 4bb5ce57..e62ef520 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -1457,7 +1457,7 @@ impl Module { } } -/// [INTERNALS] A chain of module names to qualify a variable or function call. +/// _[INTERNALS]_ A chain of module names to qualify a variable or function call. /// Exported under the `internals` feature only. /// /// A `u64` hash key is cached for quick search purposes. diff --git a/src/parser.rs b/src/parser.rs index f197ebc2..f85215d4 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -91,7 +91,8 @@ impl AST { &self.0 } - /// [INTERNALS] Get the statements. + /// _[INTERNALS]_ Get the statements. + /// Exported under the `internals` feature only. #[cfg(feature = "internals")] #[deprecated(note = "this method is volatile and may change")] pub fn statements(&self) -> &[Stmt] { @@ -109,7 +110,8 @@ impl AST { &self.1 } - /// [INTERNALS] Get the internal `Module` containing all script-defined functions. + /// _[INTERNALS]_ Get the internal `Module` containing all script-defined functions. + /// Exported under the `internals` feature only. #[cfg(feature = "internals")] #[deprecated(note = "this method is volatile and may change")] pub fn lib(&self) -> &Module { @@ -374,7 +376,7 @@ impl FnAccess { } } -/// [INTERNALS] A type containing information on a scripted function. +/// _[INTERNALS]_ A type containing information on a scripted function. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -416,7 +418,7 @@ impl fmt::Display for ScriptFnDef { } } -/// [INTERNALS] A type encapsulating the mode of a `return`/`throw` statement. +/// _[INTERNALS]_ A type encapsulating the mode of a `return`/`throw` statement. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -561,7 +563,7 @@ impl ParseSettings { } } -/// [INTERNALS] A Rhai statement. +/// _[INTERNALS]_ A Rhai statement. /// Exported under the `internals` feature only. /// /// Each variant is at most one pointer in size (for speed), @@ -721,7 +723,7 @@ impl Stmt { } } -/// [INTERNALS] A type wrapping a custom syntax definition. +/// _[INTERNALS]_ A type wrapping a custom syntax definition. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -742,7 +744,7 @@ impl Hash for CustomExpr { } } -/// [INTERNALS] A type wrapping a floating-point number. +/// _[INTERNALS]_ A type wrapping a floating-point number. /// Exported under the `internals` feature only. /// /// This type is mainly used to provide a standard `Hash` implementation @@ -763,7 +765,7 @@ impl Hash for FloatWrapper { } } -/// [INTERNALS] An expression sub-tree. +/// _[INTERNALS]_ An expression sub-tree. /// Exported under the `internals` feature only. /// /// Each variant is at most one pointer in size (for speed), diff --git a/src/token.rs b/src/token.rs index bcc758f8..3494b02e 100644 --- a/src/token.rs +++ b/src/token.rs @@ -147,7 +147,7 @@ impl fmt::Debug for Position { } } -/// [INTERNALS] A Rhai language token. +/// _[INTERNALS]_ A Rhai language token. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -709,7 +709,7 @@ impl From for String { } } -/// [INTERNALS] State of the tokenizer. +/// _[INTERNALS]_ State of the tokenizer. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -729,7 +729,7 @@ pub struct TokenizeState { pub include_comments: bool, } -/// [INTERNALS] Trait that encapsulates a peekable character input stream. +/// _[INTERNALS]_ Trait that encapsulates a peekable character input stream. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -743,7 +743,7 @@ pub trait InputStream { fn peek_next(&mut self) -> Option; } -/// [INTERNALS] Parse a string literal wrapped by `enclosing_char`. +/// _[INTERNALS]_ Parse a string literal wrapped by `enclosing_char`. /// Exported under the `internals` feature only. /// /// ## WARNING @@ -931,7 +931,7 @@ fn scan_comment( } } -/// [INTERNALS] Get the next token from the `InputStream`. +/// _[INTERNALS]_ Get the next token from the `InputStream`. /// Exported under the `internals` feature only. /// /// ## WARNING diff --git a/src/utils.rs b/src/utils.rs index a257d910..94110d1e 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -61,7 +61,7 @@ impl BuildHasher for StraightHasherBuilder { } } -/// [INTERNALS] Calculate a `u64` hash key from a module-qualified function name and parameter types. +/// _[INTERNALS]_ Calculate a `u64` hash key from a module-qualified function name and parameter types. /// Exported under the `internals` feature only. /// /// Module names are passed in via `&str` references from an iterator. @@ -89,7 +89,7 @@ pub fn calc_fn_hash<'a>( s.finish() } -/// [INTERNALS] Alias to [`smallvec::SmallVec<[T; 4]>`](https://crates.io/crates/smallvec), +/// _[INTERNALS]_ Alias to [`smallvec::SmallVec<[T; 4]>`](https://crates.io/crates/smallvec), /// which is a specialized `Vec` backed by a small, fixed-size array when there are <= 4 items stored. /// Exported under the `internals` feature only. pub type StaticVec = SmallVec<[T; 4]>;