Home
last modified time | relevance | path

Searched refs:line_starts (Results 1 - 3 of 3) sorted by relevance

/third_party/rust/crates/codespan/codespan-reporting/examples/
H A Dcustom_files.rs55 line_starts: Vec<usize>,
62 match line_index.cmp(&self.line_starts.len()) { in line_start()
64 .line_starts in line_start()
71 max: self.line_starts.len() - 1, in line_start()
104 let line_starts = files::line_starts(&source).collect(); in add()
108 line_starts, in add()
138 .line_starts in line_index()
/third_party/rust/crates/codespan/codespan-reporting/src/
H A Dfiles.rs107 /// a list of line starts that was computed by calling the [`line_starts`] in name()
111 /// [`line_starts`]: crate::files::line_starts in name()
229 /// let line_starts: Vec<_> = files::line_starts(source).collect();
232 /// line_starts,
241 /// fn line_index(line_starts: &[usize], byte_index: usize) -> Option<usize> {
242 /// match line_starts.binary_search(&byte_index) {
248 /// assert_eq!(line_index(&line_starts, 5), Some(1));
250 // NOTE: this is copied in `codespan::file::line_starts` an
251 pub fn line_starts<'source>(source: &'source str) -> impl 'source + Iterator<Item = usize> { line_starts() functions
416 fn line_starts() { line_starts() functions
[all...]
/third_party/rust/crates/codespan/codespan/src/
H A Dfile.rs271 line_starts: Vec<ByteIndex>,
279 let line_starts = line_starts(source.as_ref()) in new()
286 line_starts, in new()
291 let line_starts = line_starts(source.as_ref()) in update()
295 self.line_starts = line_starts; in update()
306 Ordering::Less => Ok(self.line_starts[line_index.to_usize()]), in line_start()
316 LineIndex::from(self.line_starts in last_line_index()
385 fn line_starts<'source>(source: &'source str) -> impl 'source + Iterator<Item = usize> { line_starts() functions
396 fn line_starts() { line_starts() functions
[all...]

Completed in 2 milliseconds