From 563f97599eb6ad36b997a5305745dd8775ba9be4 Mon Sep 17 00:00:00 2001 From: Kornel Date: Tue, 23 May 2023 00:52:40 +0100 Subject: [PATCH] Fix change to public fields This reverts commit 4fcfab26865466a0594b21caf134ba0cc7d39325. --- Cargo.toml | 2 +- src/common.rs | 10 ++++------ src/reader/lexer.rs | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8283f89d..1a1bb4cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xml-rs" -version = "0.8.12" +version = "0.8.13" authors = ["Vladimir Matveev "] license = "MIT" description = "An XML library in pure Rust" diff --git a/src/common.rs b/src/common.rs index 3b4dd100..a1bf3ac1 100644 --- a/src/common.rs +++ b/src/common.rs @@ -2,15 +2,13 @@ use std::fmt; -pub(crate) type PosUInt = u32; - /// Represents a position inside some textual document. #[derive(Copy, Clone, PartialEq, Eq)] pub struct TextPosition { /// Row, counting from 0 - pub row: PosUInt, + pub row: u64, /// Column, counting from 0 - pub column: PosUInt, + pub column: u64, } impl TextPosition { @@ -24,13 +22,13 @@ impl TextPosition { /// Advances the position in a line #[inline] pub fn advance(&mut self, count: u8) { - self.column += PosUInt::from(count); + self.column += u64::from(count); } /// Advances the position in a line to the next tab position #[inline] pub fn advance_to_tab(&mut self, width: u8) { - let width = PosUInt::from(width); + let width = u64::from(width); self.column += width - self.column % width; } diff --git a/src/reader/lexer.rs b/src/reader/lexer.rs index 33416891..f6ce5fe9 100644 --- a/src/reader/lexer.rs +++ b/src/reader/lexer.rs @@ -649,7 +649,6 @@ impl Lexer { #[cfg(test)] mod tests { - use crate::common::PosUInt; use crate::common::Position; use std::io::{BufReader, Cursor}; @@ -668,8 +667,8 @@ mod tests { let err = $lex.next_token(&mut $buf); assert!(err.is_err()); let err = err.unwrap_err(); - assert_eq!($r as PosUInt, err.position().row); - assert_eq!($c as PosUInt, err.position().column); + assert_eq!($r as u64, err.position().row); + assert_eq!($c as u64, err.position().column); }) );