mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Use alloc, core instead of std (#225)
- Replace std with alloc, core in most places in src Tests, bindings aren't changed. - Introduce BuiltinsMap type alias inplace of HashMap. In no_std case, this could be aliases to BTreeMap - Fix clippy warnings Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
0a39e434db
commit
69d6426663
@@ -3,10 +3,11 @@
|
||||
|
||||
use crate::number::Number;
|
||||
|
||||
use alloc::collections::{BTreeMap, BTreeSet};
|
||||
use core::fmt;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use core::ops;
|
||||
|
||||
use std::convert::AsRef;
|
||||
use std::ops;
|
||||
use std::path::Path;
|
||||
use std::str::FromStr;
|
||||
|
||||
@@ -100,7 +101,7 @@ struct ValueVisitor;
|
||||
impl<'de> Visitor<'de> for ValueVisitor {
|
||||
type Value = Value;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> std::fmt::Result {
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
formatter.write_str("a value")
|
||||
}
|
||||
|
||||
@@ -229,7 +230,7 @@ impl fmt::Display for Value {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match serde_json::to_string(self) {
|
||||
Ok(s) => write!(f, "{s}"),
|
||||
Err(_e) => Err(std::fmt::Error),
|
||||
Err(_e) => Err(fmt::Error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user