Remove custom serialization for Location (#104)

This commit is contained in:
Charlie Marsh 2022-09-04 17:54:45 -04:00 committed by GitHub
parent 3cf9e3b201
commit a3fb0d6c20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,25 +7,9 @@ use serde::{Deserialize, Serialize};
use crate::checks::CheckKind;
#[derive(Serialize, Deserialize)]
#[serde(remote = "Location")]
struct LocationDef {
#[serde(getter = "Location::row")]
row: usize,
#[serde(getter = "Location::column")]
column: usize,
}
impl From<LocationDef> for Location {
fn from(def: LocationDef) -> Location {
Location::new(def.row, def.column)
}
}
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Message {
pub kind: CheckKind,
#[serde(with = "LocationDef")]
pub location: Location,
pub filename: String,
}