Skip to content

Commit

Permalink
chore: format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ggiggle committed Jan 10, 2025
1 parent f79e9b3 commit cd02f15
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
27 changes: 12 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,19 @@ version = "0.4.0-rc4"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bumpalo = "3.13"
bytes = "1.9"
cfg-if = "1.0"
faststr = { version = "0.2", features = ["serde"] }
itoa = "1.0"
ref-cast = "1.0"
ryu = "1.0"
serde = { version = "1.0", features = ["rc", "derive"] }
serde_json = { version = "1.0", features = [
"float_roundtrip",
"arbitrary_precision",
] }
simdutf8 = "0.1"
bumpalo = "3.13"
bytes = "1.9"
cfg-if = "1.0"
faststr = { version = "0.2", features = ["serde"] }
itoa = "1.0"
ref-cast = "1.0"
ryu = "1.0"
serde = { version = "1.0", features = ["rc", "derive"] }
serde_json = { version = "1.0", features = ["float_roundtrip", "arbitrary_precision"] }
simdutf8 = "0.1"
sonic-number = { path = "./sonic-number", version = "0.1" }
sonic-simd = { path = "./sonic-simd", version = "0.1" }
thiserror = "2.0"
sonic-simd = { path = "./sonic-simd", version = "0.1" }
thiserror = "2.0"

[dev-dependencies]
bytes = { version = "1.4", features = ["serde"] }
Expand Down
3 changes: 2 additions & 1 deletion src/value/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,8 @@ impl From<serde_json::Value> for Value {
} else if let Some(i) = n.as_i64() {
Value::new_i64(i)
} else if let Some(n) = n.as_f64() {
Value::new_f64(n).unwrap_or(Value::new_null())
Value::new_f64(n)
.expect("serde_json Number's as_f64 api will not return NaN or Infinity")
} else {
let n = n.as_str();
Value::new_rawnum(n)
Expand Down
8 changes: 4 additions & 4 deletions src/value/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
mem::{transmute, ManuallyDrop},
ptr::NonNull,
slice::from_raw_parts,
str::{from_utf8_unchecked, FromStr},
str::from_utf8_unchecked,
sync::Arc,
};

Expand Down Expand Up @@ -1841,9 +1841,9 @@ impl From<Value> for serde_json::Value {
}
serde_json::Value::Object(obj)
}
ValueRefInner::RawNum(raw) => serde_json::Value::Number(
serde_json::Number::from_string_unchecked(raw.to_string()),
),
ValueRefInner::RawNum(raw) => {
serde_json::Number::from_string_unchecked(raw.to_string()).into()
}
ValueRefInner::RawStr(UnpackedRawStr { raw, str: _ }) => {
serde_json::Value::String(raw.to_string())
}
Expand Down

0 comments on commit cd02f15

Please sign in to comment.