diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 1 insertions, 15 deletions
@@ -28,7 +28,6 @@ pub struct PhishTank { #[derive(Deserialize)] pub struct Phish { - #[serde(deserialize_with = "deserialize_number")] pub phish_id: u64, pub url: String, pub phish_detail_url: String, @@ -36,7 +35,7 @@ pub struct Phish { #[serde(deserialize_with = "deserialize_yesno")] pub verified: bool, - pub verified_time: Option<DateTime<Utc>>, + pub verification_time: Option<DateTime<Utc>>, #[serde(deserialize_with = "deserialize_yesno")] pub online: bool, @@ -50,7 +49,6 @@ pub struct PhishDetails { pub cidr_block: String, pub announcing_network: String, pub rir: String, - pub country: String, pub detail_time: DateTime<Utc>, } @@ -66,18 +64,6 @@ impl PhishTank { } } -// Helper function to deserialize a number represented as a string. -// -// The PhishTank dataset represents numbers this way, so the default -// json deserializer implementation will only deserialize to a string. -// -fn deserialize_number<'de, D>(d: D) -> Result<u64, D::Error> - where D: Deserializer<'de> -{ - let s = String::deserialize(d)?; - u64::from_str(&s).map_err(serde::de::Error::custom) -} - // Helper function to deserialize "yes/no" into a bool. // // The PhishTank dataset uses the strings "yes" and "no" to represent |