Use PathBuf instead of String where applicable
This commit is contained in:
parent
8954b16beb
commit
d732da813b
48 changed files with 443 additions and 308 deletions
|
@ -16,6 +16,7 @@ use std::io::prelude::*;
|
|||
use std::rc::Rc;
|
||||
use std::str;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::path::Path;
|
||||
use syntax_pos::{BytePos, NO_EXPANSION, Span, MultiSpan};
|
||||
|
||||
/// Identify a position in the text by the Nth occurrence of a string.
|
||||
|
@ -48,7 +49,7 @@ fn test_harness(file_text: &str, span_labels: Vec<SpanLabel>, expected_output: &
|
|||
let output = Arc::new(Mutex::new(Vec::new()));
|
||||
|
||||
let code_map = Rc::new(CodeMap::new(FilePathMapping::empty()));
|
||||
code_map.new_filemap_and_lines("test.rs", &file_text);
|
||||
code_map.new_filemap_and_lines(Path::new("test.rs"), &file_text);
|
||||
|
||||
let primary_span = make_span(&file_text, &span_labels[0].start, &span_labels[0].end);
|
||||
let mut msp = MultiSpan::from_span(primary_span);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue