mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-01 17:32:25 +00:00
Remove custom serialization for Location (#104)
This commit is contained in:
parent
3cf9e3b201
commit
a3fb0d6c20
1 changed files with 0 additions and 16 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue