From b1d5817dd18b7b5fc102a63b084b1ee7ff4f9996 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 23:40:41 +0200 Subject: Convert code to text-size --- crates/ra_syntax/src/syntax_error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_syntax/src/syntax_error.rs') diff --git a/crates/ra_syntax/src/syntax_error.rs b/crates/ra_syntax/src/syntax_error.rs index 54acf7847..7c4511fec 100644 --- a/crates/ra_syntax/src/syntax_error.rs +++ b/crates/ra_syntax/src/syntax_error.rs @@ -2,7 +2,7 @@ use std::fmt; -use crate::{TextRange, TextUnit}; +use crate::{TextRange, TextSize}; /// Represents the result of unsuccessful tokenization, parsing /// or tree validation. @@ -23,8 +23,8 @@ impl SyntaxError { pub fn new(message: impl Into, range: TextRange) -> Self { Self(message.into(), range) } - pub fn new_at_offset(message: impl Into, offset: TextUnit) -> Self { - Self(message.into(), TextRange::offset_len(offset, 0.into())) + pub fn new_at_offset(message: impl Into, offset: TextSize) -> Self { + Self(message.into(), TextRange::empty(offset)) } pub fn range(&self) -> TextRange { -- cgit v1.2.3