pub fn relative_span(&self, dockerfile: &Dockerfile) -> (usize, Span) {
    let mut line_start_offset = 0;
    let mut lines = 0;
    for (i, c) in dockerfile.content.as_bytes().iter().enumerate() {
      if i == self.start {
        break;
      }

      if *c == b'\n' {
        lines += 1;
        line_start_offset = i + 1;
      }
    }

    let start = self.start - line_start_offset;
    let end = start + (self.end - self.start);

    (lines, Span { start, end })
  }
/// Determines the 0-indexed line number and line-relative position of this
/// span.
///
/// A reference to the Dockerfile is necessary to examine the original input
/// string. Note that if the original span crosses a newline boundary, the
/// relative span's `end` field will be larger than the line length.
Determines the 0-indexed line number and line-relative position of this
span.

A reference to the Dockerfile is necessary to examine the original input
string. Note that if the original span crosses a newline boundary, the
relative span's `end` field will be larger than the line length.
Determines the 0 - indexed line number and line - relative position of this span . A reference to the Dockerfile is necessary to examine the original input string . Note that if the original span crosses a newline boundary the relative span ' s ` end ` field will be larger than the line length .
pub fn relative_span(&self, dockerfile: &Dockerfile) -> (usize, Span) {
    let mut line_start_offset = 0;
    let mut lines = 0;
    for (i, c) in dockerfile.content.as_bytes().iter().enumerate() {
      if i == self.start {
        break;
      }
      if *c == b'\n' {
        lines += 1;
        line_start_offset = i + 1;
      }
    }
    let start = self.start - line_start_offset;
    let end = start + (self.end - self.start);
    (lines, Span { start, end })
  }
pub fn relative_span ( & self , dockerfile : & Dockerfile ) -> ( usize , Span ) { let mut line_start_offset = 0 ; let mut lines = 0 ; for ( i , c ) in dockerfile . content . as_bytes ( ) . iter ( ) . enumerate ( ) { if i == self . start { break ; } if * c == b'\n' { lines += 1 ; line_start_offset = i + 1 ; } } let start = self . start - line_start_offset ; let end = start + ( self . end - self . start ) ; ( lines , Span { start , end } ) }
Determines the 0-indexed line number and line-relative position of this
span.
Determines the 0 - indexed line number and line - relative position of this span .
&self
dockerfile
&Dockerfile