From f8f6281e41add65cf4a428d1f4fa90f32aeae2d7 Mon Sep 17 00:00:00 2001 From: Ethiraric Date: Thu, 13 Jun 2024 22:05:54 +0200 Subject: [PATCH] Add `Marker::default` and `pub` to `new`. --- parser/src/scanner.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parser/src/scanner.rs b/parser/src/scanner.rs index f3d418b..7d9fd28 100644 --- a/parser/src/scanner.rs +++ b/parser/src/scanner.rs @@ -42,7 +42,7 @@ pub enum TScalarStyle { } /// A location in a yaml document. -#[derive(Clone, Copy, PartialEq, Debug, Eq)] +#[derive(Clone, Copy, PartialEq, Debug, Eq, Default)] pub struct Marker { /// The index (in chars) in the input string. index: usize, @@ -53,7 +53,9 @@ pub struct Marker { } impl Marker { - fn new(index: usize, line: usize, col: usize) -> Marker { + /// Create a new [`Marker`] at the given position. + #[must_use] + pub fn new(index: usize, line: usize, col: usize) -> Marker { Marker { index, line, col } }