Use PathBuf instead of String where applicable

This commit is contained in:
Oliver Schneider 2017-12-14 08:09:19 +01:00
parent 8954b16beb
commit d732da813b
No known key found for this signature in database
GPG key ID: A69F8D225B3AD7D9
48 changed files with 443 additions and 308 deletions

View file

@ -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);