1use serde::Serialize;
4
5use crate::span::Span;
6
7#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
9#[serde(rename_all = "camelCase")]
10pub struct FixHint {
11 pub title: String,
12 pub explanation: String,
14 pub before: String,
16 pub after: String,
18 pub start: u32,
20 pub end: u32,
21}
22
23impl FixHint {
24 pub fn new(
25 title: impl Into<String>,
26 explanation: impl Into<String>,
27 before: impl Into<String>,
28 after: impl Into<String>,
29 span: Span,
30 ) -> Self {
31 Self {
32 title: title.into(),
33 explanation: explanation.into(),
34 before: before.into(),
35 after: after.into(),
36 start: span.start.0,
37 end: span.end.0,
38 }
39 }
40}