From a627799e2a0989201416a11b8d3bf1af0be86073 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 28 Oct 2021 17:14:21 +0530 Subject: improve json output The `at` field now includes a `from` and `to` position with line and column information, instead of a [usize; 2]. --- lib/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/src/lib.rs') diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 753e5c1..ec96f50 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -13,6 +13,12 @@ use serde::{ Serialize, }; +#[cfg_attr(feature = "json-out", derive(Serialize))] +pub struct Position { + line: usize, + column: usize, +} + /// Report generated by a lint #[derive(Debug, Default)] #[cfg_attr(feature = "json-out", derive(Serialize))] -- cgit v1.2.3