Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ halfbrown = { version = "0.4", optional = true }
indexmap = { version = "2.0", optional = true }
float-cmp = "0.10"
ordered-float = { version = "5", optional = true }
hashbrown = { version = "0.16", optional = true }
hashbrown = { version = "0.16" }
abi_stable = { version = "0.11.0", optional = true, default-features = false }
embedded-io = "0.7.1"
core_detect = "1.0.0"

[features]
default = ["custom-types", "halfbrown", "runtime-detection"]
default = ["custom-types", "runtime-detection"]
# Support for 128 bit integers
128bit = []

std = []

# Support for custom types
custom-types = []

Expand Down
4 changes: 3 additions & 1 deletion src/array.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use std::slice::SliceIndex;
use alloc::boxed::Box;
use alloc::vec::Vec;
use core::slice::SliceIndex;

/// Trait for indexing into an array
pub trait Indexed<T> {
Expand Down
10 changes: 6 additions & 4 deletions src/base.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::io::{self, Write};
use crate::io::{Write};

use crate::{TryTypeError, ValueType, array::Array, object::Object};
use alloc::string::String;

use crate::{array::Array, object::Object, IoResult, TryTypeError, ValueType};

/// Type information on a value
pub trait TypedValue {
Expand Down Expand Up @@ -244,7 +246,7 @@ pub trait Writable {
/// # Errors
///
/// Will return `Err` if an IO error is encountered
fn write<'writer, W>(&self, w: &mut W) -> io::Result<()>
fn write<'writer, W>(&self, w: &mut W) -> IoResult<()>
where
W: 'writer + Write;

Expand All @@ -253,7 +255,7 @@ pub trait Writable {
/// # Errors
///
/// Will return `Err` if an IO error is encountered.
fn write_pp<'writer, W>(&self, w: &mut W) -> io::Result<()>
fn write_pp<'writer, W>(&self, w: &mut W) -> IoResult<()>
where
W: 'writer + Write;
}
14 changes: 7 additions & 7 deletions src/derived.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::{borrow::Borrow, hash::Hash};

use core::borrow::Borrow;
use core::hash::Hash;
use crate::{AccessError, TryTypeError, array::Array, object::Object};

/// `try_as_*` access to scalar value types
Expand Down Expand Up @@ -99,7 +99,7 @@ pub trait TypedScalarValue {
#[must_use]
fn is_float(&self) -> bool;

/// returns true if the current value a integer number
/// returns true if the current value an integer number
#[must_use]
fn is_integer(&self) -> bool;

Expand Down Expand Up @@ -559,7 +559,7 @@ pub trait MutableObject {
&mut self,
k: K,
v: V,
) -> std::result::Result<Option<Self::Target>, AccessError>
) -> Result<Option<Self::Target>, AccessError>
where
Self::Key: From<K> + Hash + Eq,
V: Into<Self::Target>;
Expand All @@ -583,7 +583,7 @@ pub trait MutableObject {
/// # Errors
///
/// Will return `Err` if `self` is not an Object.
fn remove<Q>(&mut self, k: &Q) -> std::result::Result<Option<Self::Target>, AccessError>
fn remove<Q>(&mut self, k: &Q) -> Result<Option<Self::Target>, AccessError>
where
Self::Key: Borrow<Q>,
Q: ?Sized + Hash + Eq + Ord;
Expand Down Expand Up @@ -634,7 +634,7 @@ pub trait MutableArray {
/// # Errors
///
/// Will return `Err` if `self` is not an array.
fn push<V>(&mut self, v: V) -> std::result::Result<(), AccessError>
fn push<V>(&mut self, v: V) -> Result<(), AccessError>
where
V: Into<Self::Target>;

Expand All @@ -656,7 +656,7 @@ pub trait MutableArray {
/// # Errors
///
/// Will return `Err` if `self` is not an array.
fn pop(&mut self) -> std::result::Result<Option<Self::Target>, AccessError>;
fn pop(&mut self) -> Result<Option<Self::Target>, AccessError>;

/// Tries to pop from a `Value` as an `Array`.
/// if the `Value` is any other type `None` will
Expand Down
Loading