mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Iterate over arrays dirrectly, instead of going through a slice
This commit is contained in:
parent
32be158630
commit
bd04416aaa
4 changed files with 5 additions and 5 deletions
|
@ -185,14 +185,14 @@ mod tests {
|
|||
];
|
||||
|
||||
let index = LineIndex::new(text);
|
||||
for &(offset, line, col) in &table {
|
||||
for (offset, line, col) in table {
|
||||
assert_eq!(index.line_col(offset.into()), LineCol { line, col });
|
||||
}
|
||||
|
||||
let text = "\nhello\nworld";
|
||||
let table = [(0, 0, 0), (1, 1, 0), (2, 1, 1), (6, 1, 5), (7, 2, 0)];
|
||||
let index = LineIndex::new(text);
|
||||
for &(offset, line, col) in &table {
|
||||
for (offset, line, col) in table {
|
||||
assert_eq!(index.line_col(offset.into()), LineCol { line, col });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue