fn with_str_from_to<T, F>(&self, start: BytePos, end: BytePos, f: F) -> T where
F: FnOnce(&str) -> T,
{
- f(self.filemap.src.slice(
- self.byte_offset(start).to_uint(),
- self.byte_offset(end).to_uint()))
+ f(&self.filemap.src[
+ self.byte_offset(start).to_uint()..
+ self.byte_offset(end).to_uint()])
}
/// Converts CRLF to LF in the given string, raising an error on bare CR.