Skip to content

Commit

Permalink
fix: Allow integer values in magic args (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Jun 8, 2022
1 parent 8cec59e commit b1275c0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sources/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ where
type Value = Option<MagicArg>;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("string or map")
formatter.write_str("string or number")
}

fn visit_str<E>(self, value: &str) -> Result<Option<MagicArg>, E>
Expand All @@ -129,6 +129,13 @@ where
Ok(Some(MagicArg(value)))
}

fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
where
E: serde::de::Error,
{
Ok(Some(MagicArg(v as u64)))
}

fn visit_none<E>(self) -> Result<Self::Value, E>
where
E: serde::de::Error,
Expand Down

0 comments on commit b1275c0

Please sign in to comment.