From ec7b906f7153331bb03738376f43e7ae4d50aa46 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Tue, 30 Mar 2021 18:06:58 +0800 Subject: [PATCH] Patah smartstring for no-std. --- Cargo.toml | 6 ++---- no_std/no_std_test/Cargo.toml | 6 +++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4c1d6c4e..996ec7b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,12 +19,11 @@ categories = ["no-std", "embedded", "wasm", "parser-implementations"] smallvec = { version = "1.6", default-features = false, features = ["union"] } ahash = { version = "0.7", default-features = false } num-traits = { version = "0.2", default_features = false } -#smartstring = { version = "0.2.6" } -smartstring = { git = "https://github.com/okready/smartstring", branch = "fix-no_std-builds", default_features = false } +smartstring = { version = "0.2.6", default_features = false } rhai_codegen = { version = "0.3.4", path = "codegen", features = ["metadata"] } [features] -default = [] +default = ["smartstring/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_optimize = [] # no script optimizer @@ -42,7 +41,6 @@ internals = [] # expose internal data structures unicode-xid-ident = ["unicode-xid"] # allow Unicode Standard Annex #31 for identifiers. metadata = ["serde_json"] # enable exporting functions metadata -no_smartstring = [] # set Identifier=ImmutableString no_std = ["smallvec/union", "num-traits/libm", "core-error", "libm", "ahash/compile-time-rng"] # compiling for WASM diff --git a/no_std/no_std_test/Cargo.toml b/no_std/no_std_test/Cargo.toml index ec38bcc0..5ae73ab8 100644 --- a/no_std/no_std_test/Cargo.toml +++ b/no_std/no_std_test/Cargo.toml @@ -12,7 +12,7 @@ homepage = "https://github.com/rhaiscript/rhai/tree/no_std/no_std_test" repository = "https://github.com/rhaiscript/rhai" [dependencies] -rhai = { path = "../../", features = [ "no_std" ] } +rhai = { path = "../../", features = [ "no_std" ], default_features = false } wee_alloc = { version = "0.4.5", default_features = false } [profile.dev] @@ -36,3 +36,7 @@ inherits = "release" [profile.macos] inherits = "release" lto = "fat" + +[patch.crates-io] +# Patch smartstring wth a PR fix because it doesn't properly handle no-std builds. +smartstring = { git = "https://github.com/okready/smartstring", branch = "fix-no_std-builds" }