commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
b7d279a2aa8b00fde19bcc25cec87db3ab47d673
Ingvar Stepanyan
2022-09-01T15:18:33
Allow running tests in both browsers & Node Trick looked up in the wasm-bindgen repo.
diff --git a/tests/browser.rs b/tests/browser.rs new file mode 100644 index 0000000..23f51be --- /dev/null +++ b/tests/browser.rs @@ -0,0 +1,3 @@ +wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); + +mod common; diff --git a/tests/serde.rs b/tests/common/mod.rs similarity index 99% rename from tests/serd...
3
4
2
8d4b4963958efc7b0d268e4ff47cb27ffd63652a
Ingvar Stepanyan
2022-08-30T11:43:09
Remove unused import
diff --git a/benchmarks/src/color.rs b/benchmarks/src/color.rs index 02e85a0..f0ca11d 100644 --- a/benchmarks/src/color.rs +++ b/benchmarks/src/color.rs @@ -8,7 +8,7 @@ use serde::ser::{Serialize, Serializer}; #[derive(Clone, Copy)] pub struct Color(u32); -const HEX_LUT: &'static [u8] = b"\ +const HEX_LUT: &[u8] = ...
2
2
2
68978f3af6b83d7c8050695964bff37875f1542b
Ingvar Stepanyan
2022-08-30T11:17:26
Switch to `in` for `Symbol.iterator` check
diff --git a/src/de.rs b/src/de.rs index 08b4ff9..5b9904f 100644 --- a/src/de.rs +++ b/src/de.rs @@ -302,7 +302,7 @@ impl<'de> de::Deserializer<'de> for Deserializer { // // Hopefully we can rid of these hacks altogether once // https://github.com/serde-rs/serde/issues/1183 is imp...
1
1
1
34e6bb71f3769f193d955fd4d14f85973b8753cf
Ingvar Stepanyan
2022-08-30T10:52:15
Return to full range condition
diff --git a/src/ser.rs b/src/ser.rs index e396cb1..8aaebe7 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -304,9 +304,12 @@ impl<'s> ser::Serializer for &'s Serializer { return Ok(bindings::bigint_from_i64(v).into()); } + // Note: don't try to "simplify" by using `.abs()` as it can overflow...
1
4
1
1e70f1ed89a5f54fbafd426a4d5759c06e8ad04c
Ingvar Stepanyan
2022-08-30T10:47:03
Fix clippy warning
diff --git a/src/ser.rs b/src/ser.rs index 17ec794..e396cb1 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -303,10 +303,10 @@ impl<'s> ser::Serializer for &'s Serializer { if self.serialize_large_number_types_as_bigints { return Ok(bindings::bigint_from_i64(v).into()); } + const MAX...
1
2
2
bf15072c58ec1a8228e8afc1dbab41b6818fc49b
Ingvar Stepanyan
2022-08-30T10:37:54
Support `serde(default)` Alternative to #14 that only reports fields as missing if they're actually not present in the original object (in terms of JS `in` operator), but considers explicit `undefined` and `null` as valid present values. Fixes #20.
diff --git a/src/de.rs b/src/de.rs index e0415e3..08b4ff9 100644 --- a/src/de.rs +++ b/src/de.rs @@ -60,27 +60,22 @@ impl<'de> de::MapAccess<'de> for MapAccess { fn next_value_seed<V: de::DeserializeSeed<'de>>(&mut self, seed: V) -> Result<V::Value> { seed.deserialize(self.next_value.take().unwrap_throw()...
3
48
45
f645c2ae4ba1fd56788a3ac718cbcb827f56b070
Ingvar Stepanyan
2022-08-30T00:12:36
Use cheaper .unwrap_throw() where possible
diff --git a/src/de.rs b/src/de.rs index ae7fe29..e0415e3 100644 --- a/src/de.rs +++ b/src/de.rs @@ -3,7 +3,7 @@ use js_sys::{Array, ArrayBuffer, BigInt, JsString, Number, Object, Reflect, Symb use serde::de::value::{MapDeserializer, SeqDeserializer}; use serde::de::IntoDeserializer; use serde::{de, serde_if_integer...
2
4
4
35000817b0cc66d1550e15a48de1808e12e348a6
Ingvar Stepanyan
2022-05-12T13:00:52
(cargo-release) start next development iteration 0.4.4-alpha.0
diff --git a/Cargo.toml b/Cargo.toml index 303ca92..45be979 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.4.3" +version = "0.4.4-alpha.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
434ec7c44cb48679db448d1f33a03d056f513808
Ingvar Stepanyan
2022-05-12T12:59:05
(cargo-release) version 0.4.3
diff --git a/Cargo.toml b/Cargo.toml index fd80348..303ca92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.4.3-alpha.0" +version = "0.4.3" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
68c5be4c42a6c1cba360259be1db36fad1cd660b
Ingvar Stepanyan
2022-05-12T12:54:33
Simplify cache hasher Now that we're using `*const str` as a key, we don't need FNV to hash everything byte-by-byte, but instead can use the raw address of the start of the string as a hash directly. This is what I'm doing in a new custom hasher. This allows to drop dependency on fnv, very slightly improves performan...
diff --git a/Cargo.toml b/Cargo.toml index 5a9fe2e..fd80348 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ keywords = ["serde", "serialization", "javascript", "wasm", "webassembly"] serde = "^1.0" js-sys = "^0.3" wasm-bindgen = "0.2.43" -fnv = "^1.0" [dev-dependencies] wasm-bindgen-test = "0.3.24" di...
2
27
2
47bd3e9655eebf7f2172870689c8d36daf6ab002
Liam Murphy
2022-04-30T04:28:50
Use indexing instead of `push` in `ArraySerializer` For whatever reason, it seems to be quicker. I tested it under Deno (V8, same as Chrome), Firefox and GNOME Web (WebKit, same as Safari).
diff --git a/src/ser.rs b/src/ser.rs index 0158180..154d216 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -66,6 +66,7 @@ impl<S: ser::SerializeStruct<Ok = JsValue, Error = Error>> ser::SerializeStructV pub struct ArraySerializer<'s> { serializer: &'s Serializer, target: Array, + idx: u32, } impl<'s> Arr...
1
4
1
96b5f66cef3ce3f6c6c79c64827a937b8606a327
Liam Murphy
2022-04-28T03:58:34
Specialise `deserialize_seq` for arrays and `deserialize_map` for objects The generic approach uses `js-sys` iterators, which have much more overhead than just indexing into an array.
diff --git a/src/de.rs b/src/de.rs index 15c40e7..ae7fe29 100644 --- a/src/de.rs +++ b/src/de.rs @@ -1,5 +1,7 @@ use crate::bindings; use js_sys::{Array, ArrayBuffer, BigInt, JsString, Number, Object, Reflect, Symbol, Uint8Array}; +use serde::de::value::{MapDeserializer, SeqDeserializer}; +use serde::de::IntoDeserial...
1
32
16
d1b03bc00b110d0e525a857b4e33f77ffa0cba67
Liam Murphy
2022-04-15T11:58:30
Index the string cache by pointer instead of value It's quicker to do one 64-bit comparison than multiple 8-bit comparisons.
diff --git a/src/lib.rs b/src/lib.rs index caae9a9..fae4ad4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,7 +17,10 @@ type Result<T> = std::result::Result<T, Error>; fn static_str_to_js(s: &'static str) -> JsString { thread_local! { - static CACHE: std::cell::RefCell<fnv::FnvHashMap<&'static str, JsStr...
1
4
1
5a22098538cfcc6c5adba763abff53180fdf4d3b
Ingvar Stepanyan
2022-01-22T11:12:42
(cargo-release) start next development iteration 0.4.3-alpha.0
diff --git a/Cargo.toml b/Cargo.toml index e4289e6..5a9fe2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.4.2" +version = "0.4.3-alpha.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
ff54c206c164472bfc665f334f861b48bb51b88b
Ingvar Stepanyan
2022-01-22T11:10:55
(cargo-release) version 0.4.2
diff --git a/Cargo.toml b/Cargo.toml index 3e437ee..e4289e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.4.2-alpha.0" +version = "0.4.2" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
77f71fff370bb915691e1d522e48318f36b8d755
mfish33
2022-01-13T18:04:39
Fix tagged enum Bigint bug (#31)
diff --git a/src/de.rs b/src/de.rs index dbbcd9b..15c40e7 100644 --- a/src/de.rs +++ b/src/de.rs @@ -146,6 +146,26 @@ fn convert_pair(pair: JsValue) -> (Deserializer, Deserializer) { (pair.get(0).into(), pair.get(1).into()) } +fn bigint_to_i64(bigint: &BigInt) -> Option<i64> { + let converted_number = bindin...
2
55
15
d54564ccedc779c2773f1b85060c1163b65c9731
Ingvar Stepanyan
2021-12-24T17:10:56
(cargo-release) start next development iteration 0.4.2-alpha.0
diff --git a/Cargo.toml b/Cargo.toml index 9713fcb..3e437ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.4.1" +version = "0.4.2-alpha.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
8cbb21030ce34eed23df9cf0817e8fd16da7f3bc
Ingvar Stepanyan
2021-12-24T17:10:12
(cargo-release) version 0.4.1
diff --git a/Cargo.toml b/Cargo.toml index da661c0..9713fcb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.4.1-alpha.0" +version = "0.4.1" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
962c3699cc1f0fb65e97e1554e767be4630a6cd2
Ingvar Stepanyan
2021-12-24T16:56:56
(cargo-release) start next development iteration 0.4.1-alpha.0
diff --git a/Cargo.toml b/Cargo.toml index 679a911..6661145 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.4.0" +version = "0.4.1-alpha.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
98343f990c56d893d1a939cff26941e6083cbbe6
Ingvar Stepanyan
2021-12-24T16:55:15
(cargo-release) version 0.4.0
diff --git a/Cargo.toml b/Cargo.toml index aee4023..679a911 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.3.1" +version = "0.4.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
4bb362086c873117499a87dd2a7a1e532b1fb843
Ingvar Stepanyan
2021-08-27T13:41:57
(cargo-release) version 0.3.1
diff --git a/Cargo.toml b/Cargo.toml index cca2149..aee4023 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.3.1-alpha.0" +version = "0.3.1" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
7c5747c8038ec57871d1df47f5e81f9c10a3f04b
Colin Woodbury
2021-08-19T10:01:51
Drop `Sized` constraint for `to_value` (#18)
diff --git a/src/lib.rs b/src/lib.rs index 99457f3..8d84f9d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,6 +46,6 @@ pub fn from_value<T: serde::de::DeserializeOwned>(value: JsValue) -> Result<T> { } /// Converts a Rust value into a [`JsValue`]. -pub fn to_value<T: serde::ser::Serialize>(value: &T) -> Result<JsVa...
2
2
2
92aaa55d307824b039f27c596e65a2c44ecc6871
Ingvar Stepanyan
2021-06-14T01:02:05
cargo fmt
diff --git a/benchmarks/src/lib.rs b/benchmarks/src/lib.rs index 6a5e28d..e572c35 100644 --- a/benchmarks/src/lib.rs +++ b/benchmarks/src/lib.rs @@ -27,7 +27,9 @@ pub fn init_console() { } // Like serde_wasm_bindgen_to_value but with JSON-like output (no Maps). -fn serde_wasm_bindgen_to_value(value: &impl Serialize...
1
3
1
4be2c607a09056b0b9359cd44f2ea34c1085a193
Ingvar Stepanyan
2021-06-07T23:38:48
Make benchmarks fairer This doesn't seem to make any difference in timings, but it's nice to have output closer to serde-json for fair comparison.
diff --git a/benchmarks/src/lib.rs b/benchmarks/src/lib.rs index 68c0137..6a5e28d 100644 --- a/benchmarks/src/lib.rs +++ b/benchmarks/src/lib.rs @@ -26,6 +26,12 @@ pub fn init_console() { console_error_panic_hook::set_once(); } +// Like serde_wasm_bindgen_to_value but with JSON-like output (no Maps). +fn serde_...
1
9
3
011e785d42ccad99bfa04bc34fe1133ceb3869b4
Ingvar Stepanyan
2021-06-07T20:45:35
Keep function names in profiling Work around https://github.com/rustwasm/wasm-pack/issues/797.
diff --git a/Cargo.toml b/Cargo.toml index 5ec8117..cca2149 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,7 @@ members = ["benchmarks"] [profile.release] lto = true codegen-units = 1 +debug = true [features] external_doc = [] diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 3a10847..8b536...
2
4
0
b3b706e35aa2d47fa745f62915f0876ddca491a7
Ingvar Stepanyan
2021-06-07T01:29:05
Use JsString for ObjectExt keys
diff --git a/src/lib.rs b/src/lib.rs index b08a9c2..99457f3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(feature = "external_doc", doc(include = "../README.md"))] #![cfg_attr(feature = "external_doc", warn(missing_docs))] +use js_sys::JsString; use wasm_bindgen::prelude::*; mod de; @@ -1...
2
11
16
b43a4cb541106e3f66cea52d5b79c58ec72a649d
Ingvar Stepanyan
2021-06-07T01:24:31
Use Uint8Array::to_vec This exists upstream now.
diff --git a/src/de.rs b/src/de.rs index 3dbd084..01c97bc 100644 --- a/src/de.rs +++ b/src/de.rs @@ -172,12 +172,7 @@ impl Deserializer { return None; }; - let mut vec = Vec::with_capacity(v.byte_length() as _); - unsafe { - vec.set_len(v.byte_length() as _); - ...
1
1
6
e522c3a22779ac0edea84a70dba41571a597b003
Ingvar Stepanyan
2021-06-07T00:59:54
Simplify testing - Instead of replacing maps with objects after serialization, use the new Serializer config where necessary. - Use maplit for map & set literals instead of manual verbose construction.
diff --git a/Cargo.toml b/Cargo.toml index 2426c02..5ec8117 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ description = "Native Serde adapter for wasm-bindgen" categories = ["development-tools::ffi", "wasm", "encoding"] keywords = ["serde", "serialization", "javascript", "wasm", "webassembly"] +[packag...
2
64
119
af60dc075d845d65e3ba6375854b2813ec5addda
Ingvar Stepanyan
2021-06-06T23:47:18
Avoid Reflect APIs for getting properties This increases performance of benchmarks by up to 20% (citm_catalog) while reducing Wasm+Brotli size by 0.5KB.
diff --git a/src/de.rs b/src/de.rs index 023fe70..3dbd084 100644 --- a/src/de.rs +++ b/src/de.rs @@ -1,8 +1,8 @@ -use js_sys::{ArrayBuffer, JsString, Number, Object, Uint8Array}; +use js_sys::{Array, ArrayBuffer, JsString, Number, Object, Reflect, Symbol, Uint8Array}; use serde::{de, serde_if_integer128}; use wasm_bi...
3
43
46
80f54eb12d5f749b72ea11d53a8c765a7191eee1
Ingvar Stepanyan
2021-06-05T01:36:07
Fix doc comment on deserialize_struct
diff --git a/src/de.rs b/src/de.rs index f1f843d..023fe70 100644 --- a/src/de.rs +++ b/src/de.rs @@ -457,7 +457,10 @@ impl<'de> de::Deserializer<'de> for Deserializer { visitor.visit_map(map) } - /// Supports same input/output types as [`Self::deserialize_map`](#method.deserialize_map). + /// Supp...
1
4
1
f3ec0f88d958f8e08416679f0a86fec3d763babd
Ingvar Stepanyan
2021-06-04T21:42:47
(cargo-release) start next development iteration 0.3.1-alpha.0
diff --git a/Cargo.toml b/Cargo.toml index 10b85c0..2426c02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.3.0" +version = "0.3.1-alpha.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
fcd3bd18cec2009e086eb5a467acc20683fa7728
Ingvar Stepanyan
2021-06-04T21:40:23
(cargo-release) version 0.3.0
diff --git a/Cargo.toml b/Cargo.toml index 3339766..10b85c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.2.0" +version = "0.3.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
d28e8ae44b59c06c9d9f4d63b193bf3618b7274d
Ingvar Stepanyan
2020-04-16T00:38:41
Update from deprecated mem::uninitialized to MaybeUninit Reflects upstream commit: https://github.com/serde-rs/json-benchmark/commit/908f79b353cf275f31ab380ed919d8fa501f1190
diff --git a/benchmarks/src/color.rs b/benchmarks/src/color.rs index 3da4993..02e85a0 100644 --- a/benchmarks/src/color.rs +++ b/benchmarks/src/color.rs @@ -1,4 +1,5 @@ use std::fmt; +use std::mem::MaybeUninit; use std::{ptr, slice, str}; use serde::de::{self, Deserialize, Deserializer, Unexpected}; @@ -18,8 +19,9...
1
7
5
15e58677e16e3203502c725388e594ec5a88102a
Ingvar Stepanyan
2021-06-04T12:57:59
cargo fmt
diff --git a/tests/serde.rs b/tests/serde.rs index c0411f0..e69d8e1 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -275,7 +275,7 @@ fn enums() { Unit, Struct { a: A, b: B }, Sequence { seq: Vec<A> }, - Map(BTreeMap<A, B>) + Map(BTreeMap<A, B>), } test_via_json(I...
1
10
9
a3cd3a373f30187864f70984095b17b976c1c7de
Ingvar Stepanyan
2021-05-14T17:19:55
(cargo-release) version 0.2.0
diff --git a/Cargo.toml b/Cargo.toml index cb33d02..3339766 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde-wasm-bindgen" -version = "0.1.3" +version = "0.2.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] edition = "2018" readme = "README.md"
1
1
1
a00e1fc702bfde643897108ce5a26f94e6c232a4
Ingvar Stepanyan
2021-05-14T17:11:14
Bump test deps, allow testing in a browser
diff --git a/Cargo.toml b/Cargo.toml index 6a756cd..cb33d02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ wasm-bindgen = "0.2.43" fnv = "^1.0" [dev-dependencies] -wasm-bindgen-test = "0.2.43" +wasm-bindgen-test = "0.3.24" serde = { version = "^1.0", features = ["derive"] } serde_bytes = "0.11.1" ser...
2
3
1
b276aa2f3c28757560a3bf385d6a903b7ec17924
Ingvar Stepanyan
2020-04-16T02:18:13
Exclude iterables from deserialize_any
diff --git a/src/de.rs b/src/de.rs index fdea366..f1f843d 100644 --- a/src/de.rs +++ b/src/de.rs @@ -245,7 +245,19 @@ impl<'de> de::Deserializer<'de> for Deserializer { visitor.visit_string(v) } else if js_sys::Array::is_array(&self.value) { self.deserialize_seq(visitor) - } el...
1
13
1
5cf8bd2e6118e77a8822e27a6c3fe250a7853c70
Ingvar Stepanyan
2020-04-16T01:54:23
cargo fmt
diff --git a/tests/serde.rs b/tests/serde.rs index 5f54bfe..c233df2 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -1,11 +1,14 @@ +use js_sys::Reflect; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use serde_wasm_bindgen::{from_value, to_value}; -use std::{hash::Hash, collections::{HashM...
1
23
16
fb3fbd824573a8858c0b17ad304cb3b92907af33
Ingvar Stepanyan
2020-04-16T01:25:22
Remove unneeded dependency
diff --git a/Cargo.toml b/Cargo.toml index dde1c99..6a756cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,6 @@ serde = "^1.0" js-sys = "^0.3" wasm-bindgen = "0.2.43" fnv = "^1.0" -web-sys = { version = "0.3", features = ["console"] } [dev-dependencies] wasm-bindgen-test = "0.2.43"
1
0
1
e87df7759ee079716fdd4d01f3e7e5cc9900bee6
=
2020-04-01T21:06:59
Removed redundant tests
diff --git a/tests/serde.rs b/tests/serde.rs index 0e25b86..5f54bfe 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -266,10 +266,11 @@ fn enums() { #[derive(Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "tag")] - enum InternallyTagged<A, B> { + enum InternallyTagged<A, B> where A: Ord {...
1
10
85
04015f14797ab45164191fe353cd0882134a4cbd
=
2020-04-01T21:00:26
Changed back to verification with assert_json
diff --git a/tests/serde.rs b/tests/serde.rs index 74dcdc5..0e25b86 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -1,11 +1,11 @@ use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use serde_wasm_bindgen::{from_value, to_value}; -use std::{hash::Hash, collections::{HashMap, HashSet}}; +use st...
1
62
113
86dee51f3bd1ed5651e9a1229063d2ec378d451c
=
2020-03-11T02:03:58
Added sequence and map tests to the test_enum! variant
diff --git a/tests/serde.rs b/tests/serde.rs index 2dd84a1..74dcdc5 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -94,11 +94,28 @@ fn assert_js_val_eq(a: &JsValue, b: &JsValue) { } else if a.is_string() { assert!(b.is_string()); assert_eq!(a.as_string().unwrap(), b.as_string().unwrap()); + ...
1
34
0
70ea563dde2d5cf1a2d5b7be03d13d8e572b040a
=
2020-03-11T01:50:27
Added tests for maps and sequences in enums
diff --git a/tests/serde.rs b/tests/serde.rs index 6515763..2dd84a1 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -1,10 +1,11 @@ use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use serde_wasm_bindgen::{from_value, to_value}; -use std::collections::{HashMap, HashSet}; +use std::{hash::Hash...
1
144
6
2546e2dfafeb53324f7fa6c4ef07f55f287ba99d
=
2019-12-17T03:27:27
Added test cases for integer sequences
diff --git a/Cargo.toml b/Cargo.toml index 6a756cd..dde1c99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ serde = "^1.0" js-sys = "^0.3" wasm-bindgen = "0.2.43" fnv = "^1.0" +web-sys = { version = "0.3", features = ["console"] } [dev-dependencies] wasm-bindgen-test = "0.2.43" diff --git a/tests/serd...
2
5
0
bc568c2a9d66358e041bdd9db3744ac0e4ca6d03
=
2019-12-17T02:40:41
Simplified the assert_json conditions
diff --git a/tests/serde.rs b/tests/serde.rs index 5ea0873..68ef033 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -28,18 +28,16 @@ fn assert_json<R>(lhs_value: JsValue, rhs: R) where R: Serialize + DeserializeOwned + PartialEq + Debug, { - if lhs_value.is_object() || lhs_value.is_string() || lhs_value.i...
1
5
7
67b3913c3f95537d68d46b1b008efd52d9359dcf
=
2019-12-17T02:39:05
undefined values are the only problematic ones in assert_json
diff --git a/tests/serde.rs b/tests/serde.rs index caa4547..5ea0873 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -28,12 +28,12 @@ fn assert_json<R>(lhs_value: JsValue, rhs: R) where R: Serialize + DeserializeOwned + PartialEq + Debug, { - if lhs_value.is_object() || lhs_value.is_string() { + if lhs_...
1
2
2
1dd8130008a9a6aa78520d8cdd1241b51c033d75
=
2019-12-16T08:46:52
Combined is_object() and is_string() in assert_json
diff --git a/tests/serde.rs b/tests/serde.rs index d21bb06..caa4547 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -28,23 +28,18 @@ fn assert_json<R>(lhs_value: JsValue, rhs: R) where R: Serialize + DeserializeOwned + PartialEq + Debug, { - if lhs_value.is_object() { + if lhs_value.is_object() || lhs_...
1
2
7
b13bfcab69d6cf374bb0fe6e9bc76bf629b8626d
=
2019-10-18T22:27:53
Got it working with untagged enums too
diff --git a/src/de.rs b/src/de.rs index 393e8a2..fdea366 100644 --- a/src/de.rs +++ b/src/de.rs @@ -243,6 +243,8 @@ impl<'de> de::Deserializer<'de> for Deserializer { } } else if let Some(v) = self.value.as_string() { visitor.visit_string(v) + } else if js_sys::Array::is_array...
2
26
23
7d6289bd091eda4a7db587158f8ceb2e04cdfcde
=
2019-10-18T22:23:08
Got internally tagged enums working with ints
diff --git a/src/de.rs b/src/de.rs index 1c8e605..393e8a2 100644 --- a/src/de.rs +++ b/src/de.rs @@ -236,7 +236,11 @@ impl<'de> de::Deserializer<'de> for Deserializer { } else if let Some(v) = self.value.as_bool() { visitor.visit_bool(v) } else if let Some(v) = self.value.as_f64() { - ...
2
27
5
5c902ba53750bd4cdaa0e3dc3cb5109d608ffa61
=
2019-10-18T17:38:42
Got internally tagged enums working with float numbers only
diff --git a/tests/serde.rs b/tests/serde.rs index 1ffef91..8aabb1a 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -220,18 +220,18 @@ fn enums() { // Untagged // } - // #[derive(Debug, PartialEq, Serialize, Deserialize)] - // #[serde(tag = "tag")] - // enum InternallyTagged<A, B> { - //...
1
11
11
27b93b758ab5b9ac50a9e32c4ad976118d191dc4
=
2019-10-18T17:20:32
Got adjacently tagged enums working
diff --git a/src/de.rs b/src/de.rs index 37c19d5..1c8e605 100644 --- a/src/de.rs +++ b/src/de.rs @@ -239,6 +239,8 @@ impl<'de> de::Deserializer<'de> for Deserializer { visitor.visit_f64(v) } else if let Some(v) = self.value.as_string() { visitor.visit_string(v) + } else if self...
2
21
8
95768f835543d96ff83db8d22d0555412718eabb
Ingvar Stepanyan
2019-05-02T15:53:25
Change helper to perform Object::entries
diff --git a/src/de.rs b/src/de.rs index 2271858..37c19d5 100644 --- a/src/de.rs +++ b/src/de.rs @@ -153,9 +153,9 @@ fn convert_pair(pair: JsValue) -> Result<(Deserializer, Deserializer)> { impl Deserializer { /// Casts the internal value into an object, including support for prototype-less objects. /// See ...
1
5
6
6d377d4f7edb521ac5a13d18c172c055e698f08f
Ingvar Stepanyan
2019-05-02T15:53:13
Use .dyn_ref for conversion to JsString The fix to use `typeof ... === 'string'` has been merged upstream.
diff --git a/src/de.rs b/src/de.rs index 17ababb..2271858 100644 --- a/src/de.rs +++ b/src/de.rs @@ -185,16 +185,6 @@ impl Deserializer { Some(vec) } - /// Converts any JS string into a [`JsString`], while avoiding `instanceof String`. - /// See https://github.com/rustwasm/wasm-bindgen/issues/1367...
1
1
11
37c3f8649b91633c713108b7897906082a9d1c65
Ingvar Stepanyan
2019-05-02T15:50:50
Use .dyn_ref for conversion to Array The fix to use Array.isArray has been upstreamed.
diff --git a/src/de.rs b/src/de.rs index 6b3080d..17ababb 100644 --- a/src/de.rs +++ b/src/de.rs @@ -402,11 +402,8 @@ impl<'de> de::Deserializer<'de> for Deserializer { /// Supported outputs: /// - Any Rust sequence from Serde point of view ([`Vec`], [`HashSet`](std::collections::HashSet), etc.) fn dese...
1
2
5
6217c0e4d9550b795974b809ff437800ff511f80
Ingvar Stepanyan
2019-05-01T14:57:56
Leverage new char support in wasm-bindgen Char conversion has been upstreamed and simplified in https://github.com/rustwasm/wasm-bindgen/pull/1473.
diff --git a/Cargo.toml b/Cargo.toml index e85ab95..1ed035e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] serde = "^1.0" js-sys = "^0.3" -wasm-bindgen = "^0.2" +wasm-bindgen = "^0.2.43" fnv = "1.0.6" [dev-dependencies] diff --git a/src/de.rs b/src/de.rs index 8044587..6...
3
3
20
1d8b412d24595973c1bdec662c671d3c02723174
Ingvar Stepanyan
2019-04-18T17:16:53
cargo fmt
diff --git a/benchmarks/src/lib.rs b/benchmarks/src/lib.rs index 80ddb08..68c0137 100644 --- a/benchmarks/src/lib.rs +++ b/benchmarks/src/lib.rs @@ -1,6 +1,6 @@ +use serde::{Deserialize, Serialize}; use wasm_bindgen::prelude::*; use wasm_bindgen::JsValue; -use serde::{Serialize, Deserialize}; mod color; mod prim_...
3
4
6
b17e1998f166825f93294437d79ea751332d0498
Ingvar Stepanyan
2019-04-18T17:02:41
Slightly tweak serialize_field This minor reordering reads better and also saves another ~1KB of WASM+Brotli.
diff --git a/src/ser.rs b/src/ser.rs index b42fb21..6d56c8e 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -189,7 +189,8 @@ impl ser::SerializeStruct for ObjectSerializer<'_> { key: &'static str, value: &T, ) -> Result<()> { - self.target.set(static_str_to_js(key), value.serialize(self.serial...
1
2
1
b326dff026c359bdb4d5e1e442426c7e12b7e0be
Ingvar Stepanyan
2019-04-18T16:51:33
Use unchecked_ref instead of unchecked_into This helps to save ~0.7KB of WASM+Brotli by avoiding a separate Drop for Array.
diff --git a/src/de.rs b/src/de.rs index 45fd3bb..f036072 100644 --- a/src/de.rs +++ b/src/de.rs @@ -423,7 +423,7 @@ impl<'de> de::Deserializer<'de> for Deserializer { fn deserialize_seq<V: de::Visitor<'de>>(self, visitor: V) -> Result<V::Value> { let iter = if js_sys::Array::is_array(&self.value) { ...
1
1
1
01bc1c33d490bb6677b159d7d5d3877d8504c26a
Ingvar Stepanyan
2019-04-18T13:41:05
Reuse js_sys::Error::new for error construction This helps to deduplicate bindings across crates.
diff --git a/src/error.rs b/src/error.rs index f74d3a8..1dbcd52 100644 --- a/src/error.rs +++ b/src/error.rs @@ -19,13 +19,7 @@ impl std::error::Error for Error {} impl Error { pub fn new<T: std::fmt::Display>(msg: T) -> Self { - #[wasm_bindgen] - extern "C" { - #[wasm_bindgen(js_name =...
1
1
7
4f6cbadb374a9f83f3f72f56f2e0bfad43750e89
Ingvar Stepanyan
2019-04-17T13:33:12
Provide optimised next_entry_seed Normally all types will be calling this method, so despite the intuition, this actually saves ~0.5KB in WASM+Brotli.
diff --git a/src/de.rs b/src/de.rs index f2c6cc6..45fd3bb 100644 --- a/src/de.rs +++ b/src/de.rs @@ -2,7 +2,7 @@ use js_sys::{ArrayBuffer, JsString, Number, Object, Uint8Array}; use serde::{de, serde_if_integer128}; use wasm_bindgen::{JsCast, JsValue}; -use super::{Error, Result, static_str_to_js}; +use super::{sta...
1
49
9
8e93109bea7f2d8df593b164181cedf4331dece0
Ingvar Stepanyan
2019-04-17T13:17:48
Use split_first to take first field
diff --git a/src/de.rs b/src/de.rs index 4d0eaf6..f2c6cc6 100644 --- a/src/de.rs +++ b/src/de.rs @@ -65,8 +65,8 @@ impl<'de> de::MapAccess<'de> for ObjectAccess { } fn next_value_seed<V: de::DeserializeSeed<'de>>(&mut self, seed: V) -> Result<V::Value> { - let field = self.fields[0]; - self.fi...
1
2
2
7869152b5d212579ef039eeea9f3733ce0d7af8d
Ingvar Stepanyan
2019-04-16T15:55:55
Make benchmarks feature-based This helps with measuring sizes.
diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index b50afac..3a10847 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -8,8 +8,12 @@ publish = false [dependencies] console_error_panic_hook = "0.1.6" serde = { version = "^1.0", features = ["derive"] } -serde-wasm-bindgen = { path = ".." }...
2
18
2
6cffec524d1710acea1f36d9d64619c9a19da09b
Ingvar Stepanyan
2019-04-02T16:34:02
Tweak invalid_type for size This is a cold function, so we want to avoid its monomorphisations for each visitor. We can do this by adding a separate helper that uses dynamic dispatch on `de::Expected`.
diff --git a/src/de.rs b/src/de.rs index 348e2d5..4d0eaf6 100644 --- a/src/de.rs +++ b/src/de.rs @@ -158,7 +158,7 @@ impl Deserializer { } #[cold] - fn invalid_type<'de, V: de::Visitor<'de>>(&self, visitor: V) -> Result<V::Value> { + fn invalid_type_(&self, visitor: &dyn de::Expected) -> Error { ...
1
6
2
a1be78e464c74416656fa5b1f6774f139b0fdf53
Ingvar Stepanyan
2019-04-02T12:35:41
Switch to JS values as error representation
diff --git a/src/de.rs b/src/de.rs index 8665065..348e2d5 100644 --- a/src/de.rs +++ b/src/de.rs @@ -2,7 +2,7 @@ use js_sys::{ArrayBuffer, JsString, Number, Object, Uint8Array}; use serde::{de, serde_if_integer128}; use wasm_bindgen::{JsCast, JsValue}; -use super::{convert_error, Error, Result, static_str_to_js}; +...
3
78
31
408c161f1403e7a680614f65a582646d75822b2d
Ingvar Stepanyan
2019-03-25T21:23:37
Replace .unwrap() with .convert_error()
diff --git a/src/ser.rs b/src/ser.rs index 2d3e4d5..4978ea6 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -21,7 +21,7 @@ impl<S> VariantSerializer<S> { fn end(self, inner: impl FnOnce(S) -> Result) -> Result { let value = inner(self.inner)?; let obj = JsValue::from(Object::new()); - Reflect:...
1
1
1
db1c7b3e448909a57a539654189f5d9ded596770
Ingvar Stepanyan
2019-03-22T16:15:50
Roundtrip bytes test
diff --git a/tests/serde.rs b/tests/serde.rs index 6bd1cea..f006f1f 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -174,16 +174,21 @@ fn bytes() { // Store the original separately for the mutation test let orig_src = src; // Convert to a JS value - let res = to_value(&serde_bytes::Bytes::new(&src...
1
7
2
ee7e3111c4c0b53f2d04ec29d999cd4a9395499a
Ingvar Stepanyan
2019-03-22T16:12:53
Make assert_json / test_via_json roundtrip too
diff --git a/tests/serde.rs b/tests/serde.rs index f254bf1..6bd1cea 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -24,14 +24,22 @@ where test(value, value); } -fn assert_json<R: Serialize>(lhs: JsValue, rhs: R) { +fn assert_json<R>(lhs_value: JsValue, rhs: R) +where + R: Serialize + DeserializeOwned + ...
1
32
15
2800445977d8f72b7e0a593bd4bc482adb770477
Ingvar Stepanyan
2019-03-22T16:07:56
Make test() and test_primitive() helpers roundtrip Fix a revealed bug in deserialize_option.
diff --git a/src/de.rs b/src/de.rs index 6301526..38c3a6d 100644 --- a/src/de.rs +++ b/src/de.rs @@ -336,7 +336,7 @@ impl<'de> de::Deserializer<'de> for Deserializer { // Serde can deserialize `visit_unit` into `None`, but can't deserialize arbitrary value // as `Some`, so we need to provide own simple implem...
2
41
25
bdeea32ec138d07e4c9b2a1916dee109832ee73f
Ingvar Stepanyan
2019-03-22T15:19:30
Improve test_primitive bounds
diff --git a/tests/serde.rs b/tests/serde.rs index 9b05e97..f3e4f15 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -4,14 +4,12 @@ use std::collections::{HashMap, HashSet}; use wasm_bindgen::{JsCast, JsValue}; use wasm_bindgen_test::*; -fn test<L: Serialize, R: std::fmt::Debug>(lhs: L, rhs: R) -where - JsVal...
1
3
5
9140651a910b1e9953a0201545480d7f9e6991ca
Ingvar Stepanyan
2019-03-22T15:16:53
Remove repetitive `0` from test_unsigned It's already covered by ::MIN
diff --git a/tests/ser.rs b/tests/serde.rs similarity index 100% rename from tests/ser.rs rename to tests/serde.rs index 1158c35..9b05e97 100644 --- a/tests/ser.rs +++ b/tests/serde.rs @@ -31,7 +31,6 @@ fn test_via_json<T: Serialize>(value: T) { macro_rules! test_unsigned { ($ty:ident) => {{ - test_primi...
1
1
1
ae1383f481fe16a6dc8815b4346b47fb7907310b
Ingvar Stepanyan
2019-03-22T14:11:37
Add tuple ser test
diff --git a/tests/ser.rs b/tests/ser.rs index da8a80b..1158c35 100644 --- a/tests/ser.rs +++ b/tests/ser.rs @@ -234,6 +234,7 @@ fn structs() { fn sequences() { test_via_json([1, 2]); test_via_json(["", "x", "xyz"]); + test_via_json((100, "xyz", true)); // Sets are currently indistinguishable from ...
1
1
0
c433ff2881653660f716701262befc1c7ffdd46f
Ingvar Stepanyan
2019-03-22T13:58:12
Specialise functions instead of forward_to_deserialize_any!
diff --git a/src/de.rs b/src/de.rs index 1d86cd2..6301526 100644 --- a/src/de.rs +++ b/src/de.rs @@ -1,5 +1,5 @@ use js_sys::{ArrayBuffer, JsString, Number, Object, Uint8Array}; -use serde::{de, forward_to_deserialize_any, serde_if_integer128}; +use serde::{de, serde_if_integer128}; use wasm_bindgen::{JsCast, JsValue...
1
52
8
a5d20fb2673235cd7aa07e6b17df38a99d352f91
Ingvar Stepanyan
2019-03-21T22:17:20
Add comment to HashSet test
diff --git a/tests/ser.rs b/tests/ser.rs index ac60ff1..da8a80b 100644 --- a/tests/ser.rs +++ b/tests/ser.rs @@ -234,6 +234,9 @@ fn structs() { fn sequences() { test_via_json([1, 2]); test_via_json(["", "x", "xyz"]); + + // Sets are currently indistinguishable from other sequences for + // Serde serial...
1
3
0
285a0c1bace3db11976a1925edc0fb16fe1ee35d
Ingvar Stepanyan
2019-03-21T22:16:07
Add ser tests for generic key-value maps
diff --git a/tests/ser.rs b/tests/ser.rs index a3b2434..ac60ff1 100644 --- a/tests/ser.rs +++ b/tests/ser.rs @@ -1,6 +1,7 @@ use serde::Serialize; use serde_wasm_bindgen::to_value; -use wasm_bindgen::{JsValue, JsCast}; +use std::collections::{HashMap, HashSet}; +use wasm_bindgen::{JsCast, JsValue}; use wasm_bindgen_...
1
61
10
b9623006b57a3f4947cc44e7139eb69221d3a7ca
Ingvar Stepanyan
2019-03-21T21:18:03
Add untagged enum and struct ser tests
diff --git a/tests/ser.rs b/tests/ser.rs index 4957372..a3b2434 100644 --- a/tests/ser.rs +++ b/tests/ser.rs @@ -193,4 +193,37 @@ fn enums() { #[serde(tag = "tag", content = "content")] AdjacentlyTagged } + test_enum! { + #[serde(untagged)] + Untagged + } +} + +#[wasm_bindgen_...
1
33
0
85a295dfaaa5a878806a6ced83942ba6f12546d5
Ingvar Stepanyan
2019-03-21T18:21:54
Add enum tests and fix a bug
diff --git a/Cargo.toml b/Cargo.toml index eef2d2b..1563d3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,4 +11,6 @@ wasm-bindgen = "^0.2" [dev-dependencies] wasm-bindgen-test = "0.2.39" +serde = { version = "^1.0", features = ["derive"] } serde_bytes = "0.10.5" +serde_json = "1.0.39" diff --git a/src/ser.rs b/s...
3
48
1
cdddcd02541e521a077e7342736820e019bc6300
Ingvar Stepanyan
2019-03-21T17:56:13
Add serialize_option tests
diff --git a/tests/ser.rs b/tests/ser.rs index b434344..18d8291 100644 --- a/tests/ser.rs +++ b/tests/ser.rs @@ -132,3 +132,20 @@ fn bytes() { // Finally, compare that resulting storage with the original. assert_eq!(orig_src, dst); } + +#[wasm_bindgen_test] +fn options() { + test(Some(0_u32), 0_u32); + ...
1
17
0
4c4c7ad6a89e2e92c7069851ad2eb11fb621703b
Ingvar Stepanyan
2019-03-21T17:56:00
Rename void to unit
diff --git a/tests/ser.rs b/tests/ser.rs index 7acdd7c..b434344 100644 --- a/tests/ser.rs +++ b/tests/ser.rs @@ -50,7 +50,7 @@ macro_rules! test_float { } #[wasm_bindgen_test] -fn void() { +fn unit() { test((), JsValue::UNDEFINED); }
1
1
1
b37e06befa8399d0b0d109e916e6fdd55f741c8b
Ingvar Stepanyan
2019-03-21T17:48:42
Add serialize_bytes test
diff --git a/Cargo.toml b/Cargo.toml index c89a807..eef2d2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,3 +11,4 @@ wasm-bindgen = "^0.2" [dev-dependencies] wasm-bindgen-test = "0.2.39" +serde_bytes = "0.10.5" diff --git a/tests/ser.rs b/tests/ser.rs index 5b3bccd..7acdd7c 100644 --- a/tests/ser.rs +++ b/tests/s...
2
21
1
b083cf814256394a6991f810a9ed1b859dad1adf
Ingvar Stepanyan
2019-03-21T16:40:19
Add basic ser tests and fix a bug Fix a bug where using `.abs()` on a minimum i64 number failed with an overflow.
diff --git a/src/ser.rs b/src/ser.rs index 88ef962..a839daa 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -241,8 +241,9 @@ impl<'s> ser::Serializer for &'s Serializer { // TODO: we might want to support `BigInt` here in the future. fn serialize_i64(self, v: i64) -> Result { const MAX_SAFE_INTEGER: i64 ...
2
117
1
9889386c0b4402733c940c61281e91362d7795d3
Ingvar Stepanyan
2019-03-21T16:39:31
Use 2018 edition
diff --git a/Cargo.toml b/Cargo.toml index 5f3cbd3..c89a807 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,8 +2,12 @@ name = "serde-wasm-bindgen" version = "0.1.0" authors = ["Ingvar Stepanyan <me@rreverser.com>"] +edition = "2018" [dependencies] serde = "^1.0" js-sys = "^0.3" wasm-bindgen = "^0.2" + +[dev-dep...
2
4
4
ee76ad32f604c33a977c8a53b2478cc1cee73114
Ingvar Stepanyan
2019-03-20T15:32:31
Add JsValue serializer
diff --git a/src/lib.rs b/src/lib.rs index 5c6a9b9..5556bc7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,3 +24,7 @@ fn convert_error(err: JsValue) -> Error { pub fn from_value<T: serde::de::DeserializeOwned>(value: JsValue) -> Result<T> { T::deserialize(Deserializer::from(value)) } + +pub fn to_value<T: serde...
2
380
0
f8912b04d6dd1a6b2eca274f0ff0db1899c08bbb
Ingvar Stepanyan
2019-03-20T15:29:12
Add convenience alias for `Result`
diff --git a/src/de.rs b/src/de.rs index 1756180..1d86cd2 100644 --- a/src/de.rs +++ b/src/de.rs @@ -2,7 +2,7 @@ use js_sys::{ArrayBuffer, JsString, Number, Object, Uint8Array}; use serde::{de, forward_to_deserialize_any, serde_if_integer128}; use wasm_bindgen::{JsCast, JsValue}; -use super::{convert_error, Error};...
2
36
58
b4240dc34b30dd4f46c10b721f41827cccfa898e
Ingvar Stepanyan
2019-03-20T13:55:19
Fix error in function signature
diff --git a/src/lib.rs b/src/lib.rs index 7119370..72ea1ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,6 +20,6 @@ fn convert_error(err: JsValue) -> Error { )) } -pub fn from_value<T: serde::de::DeserializeOwned>(value: JsValue) -> Result<T, de::Error> { +pub fn from_value<T: serde::de::DeserializeOwned>(va...
1
1
1
bf090f332a0d7b2d05ca9273ad93fce1603ee5f0
Ingvar Stepanyan
2019-03-20T13:43:04
Add check for negative numbers in deserialize_u*
diff --git a/src/de.rs b/src/de.rs index acd40e7..1756180 100644 --- a/src/de.rs +++ b/src/de.rs @@ -259,8 +259,8 @@ impl<'de> de::Deserializer<'de> for Deserializer { fn deserialize_u64<V: de::Visitor<'de>>(self, visitor: V) -> Result<V::Value, Self::Error> { match self.as_safe_integer() { - ...
1
2
2
7997cf6aafda0cfdbe57029239b6b131aece148f
Ingvar Stepanyan
2019-03-20T13:28:02
Move out error and conversion upwards
diff --git a/src/de.rs b/src/de.rs index aaadff2..acd40e7 100644 --- a/src/de.rs +++ b/src/de.rs @@ -2,7 +2,7 @@ use js_sys::{ArrayBuffer, JsString, Number, Object, Uint8Array}; use serde::{de, forward_to_deserialize_any, serde_if_integer128}; use wasm_bindgen::{JsCast, JsValue}; -pub use serde::de::value::Error; +...
2
12
10
567a17bb98700fdfe18656077c021764378d6875
Ingvar Stepanyan
2019-03-20T13:14:39
Improve safe integer detection Use Number.isSafeInteger on the JS side to check if value is a safe integer (which will perform all the necessary checks for both bounds and mantissa), and then convert it to `i64`. Forward `u64`, `u128` and `i128` to this single `i64` helper since any safe integer is guaranteed to be i...
diff --git a/src/de.rs b/src/de.rs index 7bf0383..aaadff2 100644 --- a/src/de.rs +++ b/src/de.rs @@ -1,6 +1,4 @@ -#![allow(clippy::float_cmp)] - -use js_sys::{ArrayBuffer, JsString, Object, Uint8Array}; +use js_sys::{ArrayBuffer, JsString, Number, Object, Uint8Array}; use serde::{de, forward_to_deserialize_any, serde_...
1
30
20
761d705c5ab632eaf6dc74c29397d61b344ef762
Alexander Kjäll
2026-03-30T03:25:37
build: upgrade const-str to 0.7 (#65) Co-authored-by: Nugine <nugine@foxmail.com>
diff --git a/Cargo.lock b/Cargo.lock index cfbdc9b..936b075 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -47,7 +47,7 @@ name = "base64-simd" version = "0.9.0-dev" dependencies = [ "base64", - "const-str", + "const-str 0.6.4", "getrandom", "outref", "rand", @@ -107,6 +107,12 @@ version = "0.6.4" source = "regi...
2
9
3
6f0e875e9b9b7c6fe73f6f32d9aec9a18e26525f
Copilot
2026-03-26T23:59:58
Fix nightly unused ARM feature gates (#66) Agent-Logs-Url: https://github.com/Nugine/simd/sessions/ecefbee2-a139-434b-9860-c712650fec53 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com>
diff --git a/crates/base32-simd/src/lib.rs b/crates/base32-simd/src/lib.rs index d0710c7..4d5a2b8 100644 --- a/crates/base32-simd/src/lib.rs +++ b/crates/base32-simd/src/lib.rs @@ -19,7 +19,7 @@ #![doc=vsimd::shared_docs!()] // #![cfg_attr(not(any(feature = "std", test)), no_std)] -#![cfg_attr(feature = "unstable", ...
4
4
4
0d8b754b9d47b2c9c595412138d24360be540bd9
Ben Beasley
2026-03-05T07:08:37
Move `use rand::RngExt` to test routines to avoid unused import (#64)
diff --git a/crates/base64-simd/tests/it.rs b/crates/base64-simd/tests/it.rs index 97a07f3..5c4df47 100644 --- a/crates/base64-simd/tests/it.rs +++ b/crates/base64-simd/tests/it.rs @@ -1,8 +1,7 @@ use base64_simd::{AsOut, Base64}; use base64_simd::{STANDARD, STANDARD_NO_PAD, URL_SAFE, URL_SAFE_NO_PAD}; -#[allow(unu...
2
6
4
58618b9649ff7852d11514e0f3946bde59b9dff2
Ben Beasley
2026-03-04T14:22:11
Update rand dev-dependency to 0.10 (#63) * Update rand dev-dependency to 0.10 * upgrade getrandom * allow RngExt --------- Co-authored-by: Nugine <nugine@foxmail.com>
diff --git a/Cargo.lock b/Cargo.lock index e9133d4..cfbdc9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c86...
10
277
57
fb39ccc8be3711d7c4367056dc367247ce3e4248
Copilot
2026-02-01T17:38:01
fix: remove obsolete LaneCount/SupportedLaneCount trait bounds (#59) * Initial plan * fix: remove obsolete LaneCount/SupportedLaneCount trait bounds from unstable.rs Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.g...
diff --git a/crates/vsimd/src/unstable.rs b/crates/vsimd/src/unstable.rs index e2a1b90..02ca5e8 100644 --- a/crates/vsimd/src/unstable.rs +++ b/crates/vsimd/src/unstable.rs @@ -1,10 +1,9 @@ -use core::simd::*; +use core::simd::{Simd, SimdElement}; #[inline(always)] pub fn splat<T, const N: usize>(x: T) -> Simd<T, N...
1
1
2
1ca99584d4a39effa3d17b7d94277c36103f8d5d
Michel Lind
2026-01-03T10:04:15
Bump base64 to 0.22 (#58) Fedora already carries base64 0.22, all tests pass - bumping this will allow us to not have to carry a compatibility crate for base64 0.20 (for the released base64-simd) or 0.21 (for the development version) Signed-off-by: Michel Lind <salimma@fedoraproject.org>
diff --git a/crates/base64-simd/Cargo.toml b/crates/base64-simd/Cargo.toml index dbf0959..bbd0e23 100644 --- a/crates/base64-simd/Cargo.toml +++ b/crates/base64-simd/Cargo.toml @@ -28,7 +28,7 @@ vsimd = { path = "../vsimd", version = "0.9.0-dev" } rayon = { version = "1.6.1", optional = true } [dev-dependencies] -b...
1
1
1
9f3572784820d1e4a305e4dd650f9b826aca2762
Copilot
2025-12-21T19:07:53
Fix clippy needless_type_cast warnings in base32-simd (#57) * Initial plan * Fix clippy needless_type_cast warnings in base32-simd Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Nugine <...
diff --git a/crates/base32-simd/src/encode.rs b/crates/base32-simd/src/encode.rs index 2212e25..54858e1 100644 --- a/crates/base32-simd/src/encode.rs +++ b/crates/base32-simd/src/encode.rs @@ -42,13 +42,13 @@ pub unsafe fn read_be_bytes<const N: usize>(src: *const u8) -> u64 { { if N == 3 { l...
1
4
4
a5d077fe1749292d4bc0a7ad2b7be54e545aad35
Copilot
2025-08-18T02:33:39
Fix CI error by removing unknown feature `array_chunks` (#56) * Initial plan * Fix CI error by removing unknown feature array_chunks Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Nugine...
diff --git a/crates/vsimd/src/lib.rs b/crates/vsimd/src/lib.rs index 09b12ec..8ccd8ca 100644 --- a/crates/vsimd/src/lib.rs +++ b/crates/vsimd/src/lib.rs @@ -1,6 +1,6 @@ //! ⚠️ This crate contains shared implementation details. Do not directly depend on it. #![cfg_attr(not(any(test, feature = "std")), no_std)] -#![cfg...
1
1
1
964f35866692d820a322849ddf8be66a9277ad27
Alexander Kjäll
2025-08-18T02:11:56
bump const-str to 0.6 (#54)
diff --git a/crates/base64-simd/Cargo.toml b/crates/base64-simd/Cargo.toml index 9df2dff..dbf0959 100644 --- a/crates/base64-simd/Cargo.toml +++ b/crates/base64-simd/Cargo.toml @@ -30,7 +30,7 @@ rayon = { version = "1.6.1", optional = true } [dev-dependencies] base64 = "0.21.0" rand = "0.8.5" -const-str = "0.5.3" +c...
2
2
2
50bf71fb11dbf2c1393f154356b4ddff6e2817e5
Nugine
2025-02-23T06:48:36
fix: lints
diff --git a/crates/hex-simd/src/heap.rs b/crates/hex-simd/src/heap.rs index 784991d..33bb374 100644 --- a/crates/hex-simd/src/heap.rs +++ b/crates/hex-simd/src/heap.rs @@ -115,7 +115,6 @@ impl FromHexDecode for Vec<u8> { #[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] impl FromHexEncode for Box<[u8]> { #[inlin...
2
1
4
678a9611a2f4fe1b3e9bdd20f63a15d835e5cb9c
Nugine
2025-01-18T08:58:18
fix: unexpected_cfgs (#49)
diff --git a/crates/base32-simd/build.rs b/crates/base32-simd/build.rs new file mode 100644 index 0000000..25e7e80 --- /dev/null +++ b/crates/base32-simd/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rustc-check-cfg=cfg(vsimd_dump_symbols)") +} diff --git a/crates/base64-simd/build.rs b/crates/base64-simd/...
5
15
0
6817809f70300224edc341e49d9453011658c44e
Nugine
2024-05-02T14:15:30
fix lints
diff --git a/crates/vsimd/src/lib.rs b/crates/vsimd/src/lib.rs index ef7273b..09b12ec 100644 --- a/crates/vsimd/src/lib.rs +++ b/crates/vsimd/src/lib.rs @@ -1,11 +1,6 @@ //! ⚠️ This crate contains shared implementation details. Do not directly depend on it. #![cfg_attr(not(any(test, feature = "std")), no_std)] -#![cf...
1
1
6
77703beeb183844a15620fa3c427be02534b44bf
Nugine
2024-04-21T14:29:22
vsimd: alsw: workaround for vpavgb
diff --git a/crates/vsimd/src/alsw.rs b/crates/vsimd/src/alsw.rs index 164f633..ead72bf 100644 --- a/crates/vsimd/src/alsw.rs +++ b/crates/vsimd/src/alsw.rs @@ -77,8 +77,8 @@ pub fn check_ascii_xn<S: Scalable<V>, V: POD>(s: S, x: V, check: AlswLut<V>) -> pub fn decode_ascii_xn<S: Scalable<V>, V: POD>(s: S, x: V, check...
1
38
2