mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
cleanup
This commit is contained in:
parent
48832ffa84
commit
8e8f93955e
3 changed files with 6 additions and 146 deletions
|
@ -67,7 +67,7 @@ impl Color {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn can_problem(filename: PathBuf, file_content: &str, problem: Problem) -> Report {
|
||||
pub fn can_problem(filename: PathBuf, problem: Problem) -> Report {
|
||||
let mut texts = Vec::new();
|
||||
|
||||
match problem {
|
||||
|
@ -187,6 +187,7 @@ pub fn url(str: &str) -> ReportText {
|
|||
Url(Box::from(str))
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn newline() -> ReportText {
|
||||
plain_text("\n")
|
||||
}
|
||||
|
@ -508,28 +509,3 @@ impl ReportText {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn region_slice<'a>(region: roc_region::all::Region, buffer: &'a str) -> &'a str {
|
||||
let mut start = 0;
|
||||
let mut end = 0;
|
||||
|
||||
let it = (0..).zip(buffer.lines());
|
||||
for (index, line) in it {
|
||||
if index < region.start_line as usize {
|
||||
let size = line.len() + 1;
|
||||
start += size;
|
||||
} else if index < region.end_line as usize {
|
||||
let size = line.len() + 1;
|
||||
end += size;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
end += start;
|
||||
|
||||
start += region.start_col as usize;
|
||||
end += region.end_col as usize;
|
||||
|
||||
&buffer[start..end]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue