diff --git a/typed/src/common/span.rs b/typed/src/common/span.rs index a97510fe91..ac58c59c8b 100644 --- a/typed/src/common/span.rs +++ b/typed/src/common/span.rs @@ -45,40 +45,3 @@ impl<'ast> From> for Span { } } } - -pub fn find_line_start(pos: &Position) -> usize { - let input = pos.line_of(); - if input.is_empty() { - return 0; - }; - - // Position's pos is always a UTF-8 border. - let start = input - .char_indices() - .rev() - .skip_while(|&(i, _)| i >= pos.pos()) - .find(|&(_, c)| c == '\n'); - match start { - Some((i, _)) => i, - None => 0, - } -} - -pub fn find_line_end(pos: &Position) -> usize { - let input = pos.line_of(); - if input.is_empty() { - 0 - } else if pos.pos() == input.len() - 1 { - input.len() - } else { - // Position's pos is always a UTF-8 border. - let end = input - .char_indices() - .skip_while(|&(i, _)| i < pos.pos()) - .find(|&(_, c)| c == '\n'); - match end { - Some((i, _)) => i, - None => input.len(), - } - } -}