Hi, I'm having trouble de-serializing i128 when it is in a tagged enum. Here's a MWE of the bug. Any ideas why this might happen? Am I doing something wrong? It works when I replace the i128 with a i64.
$ cargo run
Error: i128 is not supported
main.rs
```rust
use indoc::indoc;
use anyhow::Result;
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize)]
pub struct IntegerType {
pub value: T,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(tag = "type")]
pub enum Type {
// replacing i128/u128 by i64/u64 works
#[serde(rename(deserialize = "signed"))]
Signed(IntegerType),
#[serde(rename(deserialize = "unsigned"))]
Unsigned(IntegerType),
}
fn main() -> Result<()> {
let yaml = indoc! {"
type: signed
value: 123
"};
let yaml: Type = serde_yaml::from_str(yaml)?;
println!("{:#?}", yaml);
Ok(())
}
```
Cargo.lock
```toml
[package]
name = "test-serde-yaml"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow = "1"
indoc = "2"
serde_yaml = "0.9"
serde = { version = "1", features = ["derive"] }
```
Hi, I'm having trouble de-serializing i128 when it is in a tagged enum. Here's a MWE of the bug. Any ideas why this might happen? Am I doing something wrong? It works when I replace the
i128
with ai64
.main.rs
```rust use indoc::indoc; use anyhow::Result; use serde::Deserialize; #[derive(Clone, Debug, Deserialize)] pub struct IntegerTypeCargo.lock
```toml [package] name = "test-serde-yaml" version = "0.1.0" edition = "2021" [dependencies] anyhow = "1" indoc = "2" serde_yaml = "0.9" serde = { version = "1", features = ["derive"] } ```