diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-12-14 08:09:19 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-12-14 11:22:08 +0100 |
| commit | d732da813bac73d2c81caddd06df3df3d9609e3d (patch) | |
| tree | cd0e25895e11c8c70e296b98de5fc8a16073c324 /src/libsyntax/util | |
| parent | 8954b16beb844fcac0cefe229e1c714a17de16e5 (diff) | |
| download | rust-d732da813bac73d2c81caddd06df3df3d9609e3d.tar.gz rust-d732da813bac73d2c81caddd06df3df3d9609e3d.zip | |
Use PathBuf instead of String where applicable
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/parser_testing.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index d993ba14a4a..42cd7c8faa5 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -16,16 +16,18 @@ use parse::parser::Parser; use ptr::P; use tokenstream::TokenStream; use std::iter::Peekable; +use std::path::PathBuf; /// Map a string to tts, using a made-up filename: pub fn string_to_stream(source_str: String) -> TokenStream { let ps = ParseSess::new(FilePathMapping::empty()); - filemap_to_stream(&ps, ps.codemap().new_filemap("bogofile".to_string(), source_str), None) + filemap_to_stream(&ps, ps.codemap() + .new_filemap(PathBuf::from("bogofile").into(), source_str), None) } /// Map string to parser (via tts) pub fn string_to_parser<'a>(ps: &'a ParseSess, source_str: String) -> Parser<'a> { - new_parser_from_source_str(ps, "bogofile".to_string(), source_str) + new_parser_from_source_str(ps, PathBuf::from("bogofile").into(), source_str) } fn with_error_checking_parse<'a, T, F>(s: String, ps: &'a ParseSess, f: F) -> T where |
