Change offset to 0

This commit is contained in:
Esteban Küber
2018-02-01 12:02:22 -08:00
parent fa7767e1ea
commit df412ce208
+1 -1
View File
@@ -598,7 +598,7 @@ pub fn span_until_char(&self, sp: Span, c: char) -> Span {
/// If `sp` points to `"let mut x"`, then a span pointing at `"let "` will be returned.
pub fn span_until_non_whitespace(&self, sp: Span) -> Span {
if let Ok(snippet) = self.span_to_snippet(sp) {
let mut offset = 1;
let mut offset = 0;
// get the bytes width of all the non-whitespace characters
for c in snippet.chars().take_while(|c| !c.is_whitespace()) {
offset += c.len_utf8();