mirror of https://github.com/astral-sh/ruff
Remove custom serialization for Location
This commit is contained in:
parent
533b4e752b
commit
8e182a6d75
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue