From 1fbbb2a40deafb0b4e9e2b02ac12bf044e3c9f7b Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 22 Apr 2021 23:09:10 +0800 Subject: [PATCH] Fix doc test. --- Cargo.toml | 2 +- src/engine_api.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index eb0872db..7e6d2d03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ smartstring = { version = "0.2.6", default_features = false } rhai_codegen = { version = "0.3.4", path = "codegen", default_features = false } [features] -default = ["no_position", "smartstring/std", "ahash/std", "num-traits/std"] # remove 'smartstring/std' when smartstring is updated to support no-std +default = ["smartstring/std", "ahash/std", "num-traits/std"] # remove 'smartstring/std' when smartstring is updated to support no-std unchecked = [] # unchecked arithmetic sync = [] # restrict to only types that implement Send + Sync no_position = [] # do not track position in the parser diff --git a/src/engine_api.rs b/src/engine_api.rs index f67d790a..973b1a5c 100644 --- a/src/engine_api.rs +++ b/src/engine_api.rs @@ -2166,7 +2166,10 @@ impl Engine { /// ast.set_source("world"); /// engine.consume_ast(&ast)?; /// + /// #[cfg(not(feature = "no_position"))] /// assert_eq!(*result.read().unwrap(), r#"world @ 1:18 > "hello""#); + /// #[cfg(feature = "no_position")] + /// assert_eq!(*result.read().unwrap(), r#"world @ none > "hello""#); /// # Ok(()) /// # } /// ```