From 20d195988de1014517ff1a1c8c1041cff5f88e05 Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 26 Oct 2021 19:18:28 +0530 Subject: set internal crates to 0.0.0, bump to v0.2.0 --- bin/src/fix/all.rs | 4 ++-- bin/src/fix/single.rs | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'bin/src/fix') diff --git a/bin/src/fix/all.rs b/bin/src/fix/all.rs index 8c0770d..7f04f2c 100644 --- a/bin/src/fix/all.rs +++ b/bin/src/fix/all.rs @@ -3,7 +3,7 @@ use std::borrow::Cow; use lib::{Report, LINTS}; use rnix::{parser::ParseError as RnixParseErr, WalkEvent}; -use crate::fix::{Fixed, FixResult}; +use crate::fix::{FixResult, Fixed}; fn collect_fixes(source: &str) -> Result, RnixParseErr> { let parsed = rnix::parse(source).as_result()?; @@ -73,7 +73,7 @@ impl<'a> Iterator for FixResult<'a> { Some(FixResult { src: self.src.clone(), - fixed + fixed, }) } } diff --git a/bin/src/fix/single.rs b/bin/src/fix/single.rs index 24b5c51..c09c710 100644 --- a/bin/src/fix/single.rs +++ b/bin/src/fix/single.rs @@ -12,7 +12,11 @@ pub struct SingleFixResult<'δ> { fn pos_to_byte(line: usize, col: usize, src: &str) -> Result { let mut byte: TextSize = TextSize::of(""); - for (l, _) in src.split_inclusive('\n').zip(1..).take_while(|(_, i)| i < &line) { + for (l, _) in src + .split_inclusive('\n') + .zip(1..) + .take_while(|(_, i)| i < &line) + { byte += TextSize::of(l); } byte += TextSize::try_from(col).map_err(|_| SingleFixErr::Conversion(col))?; @@ -45,8 +49,8 @@ fn find(offset: TextSize, src: &str) -> Result { } else { None } - }, - _ => None + } + _ => None, }) .flatten() .next() @@ -60,7 +64,5 @@ pub fn single(line: usize, col: usize, src: &str) -> Result