Very similar to this issue: #99
However, I ran into this problem when deserializing to a RawValue.
let json_str2 = &[ b'"', b'\xCE', b'\xF8', b'"'];
let v2: serde_json::Result<Box<serde_json::value::RawValue>> = serde_json::from_slice(json_str2);
I get this kind of backtrace:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 1, error_len: Some(1) }', C:\Users\X\.cargo\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.63\src\read.rs:590:39
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b\/library\std\src\panicking.rs:493
1: core::panicking::panic_fmt
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b\/library\core\src\panicking.rs:92
2: core::option::expect_none_failed
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b\/library\core\src\option.rs:1268
3: core::result::Result<str, core::str::error::Utf8Error>::unwrap<str,core::str::error::Utf8Error>
at C:\Users\X\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\result.rs:973
4: serde_json::read::{{impl}}::end_raw_buffering<serde_json::raw::{{impl}}::deserialize::BoxedVisitor>
at C:\Users\X\.cargo\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.63\src\read.rs:590
5: serde_json::de::Deserializer<serde_json::read::SliceRead>::deserialize_raw_value<serde_json::read::SliceRead,serde_json::raw::{{impl}}::deserialize::BoxedVisitor>
at C:\Users\X\.cargo\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.63\src\de.rs:1194
6: serde_json::de::{{impl}}::deserialize_newtype_struct<serde_json::read::SliceRead,serde_json::raw::{{impl}}::deserialize::BoxedVisitor>
at C:\Users\X\.cargo\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.63\src\de.rs:1695
7: serde_json::raw::{{impl}}::deserialize<mut serde_json::de::Deserializer<serde_json::read::SliceRead>*>
at C:\Users\X\.cargo\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.63\src\raw.rs:347
8: serde_json::de::from_trait<serde_json::read::SliceRead,alloc::boxed::Box<serde_json::raw::RawValue, alloc::alloc::Global>>
at C:\Users\X\.cargo\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.63\src\de.rs:2386
9: serde_json::de::from_slice<alloc::boxed::Box<serde_json::raw::RawValue, alloc::alloc::Global>>
at C:\Users\X\.cargo\registry\src\github.com-1ecc6299db9ec823\serde_json-1.0.63\src\de.rs:2544
10: gltf_data_packer::main
at .\src\main.rs:34
11: core::ops::function::FnOnce::call_once<fn(),tuple<>>
at C:\Users\X\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
I encountered this issue when parsing a glTF-file: gltf-rs/gltf#298
Very similar to this issue: #99
However, I ran into this problem when deserializing to a RawValue.
I get this kind of backtrace:
I encountered this issue when parsing a glTF-file: gltf-rs/gltf#298