Switch to TryFrom

This commit is contained in:
Aleksey Kladov 2020-04-25 00:57:47 +02:00
parent dc2151085e
commit 63a462f37c
13 changed files with 63 additions and 53 deletions

View file

@ -121,7 +121,7 @@ fn assert_errors_are_absent(errors: &[SyntaxError], path: &Path) {
fn dump_tokens_and_errors(tokens: &[Token], errors: &[SyntaxError], text: &str) -> String {
let mut acc = String::new();
let mut offset = TextSize::from_usize(0);
let mut offset: TextSize = 0.into();
for token in tokens {
let token_len = token.len;
let token_text = &text[TextRange::at(offset, token.len)];