From 1a944f47ed20148548a59fddb71b93646f4be1ce Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 18 Oct 2024 10:08:05 -0700 Subject: [PATCH] Delete Value::as_i128 This is adequately supported by `value.as_number().and_then(Number::as_i128)` --- src/value/mod.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/value/mod.rs b/src/value/mod.rs index 704577e9c..6b40f9a52 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -635,24 +635,6 @@ impl Value { } } - /// If the `Value` is an integer, represent it as i128 if possible. Returns - /// None otherwise. - /// - /// ``` - /// # use serde_json::json; - /// # - /// let v = json!({ "a": 64, "b": 256.0 }); - /// - /// assert_eq!(v["a"].as_i128(), Some(64)); - /// assert_eq!(v["b"].as_i128(), None); - /// ``` - pub fn as_i128(&self) -> Option { - match self { - Value::Number(n) => n.as_i128(), - _ => None, - } - } - /// If the `Value` is an integer, represent it as u64 if possible. Returns /// None otherwise. ///