1
Fork 0

Remove the Cow from Directory.

The previous commit wrapped `Parser` within a `Cow` for the hot macro
parsing path. As a result, there's no need for the `Cow` within
`Directory`, because it lies within `Parser`.
This commit is contained in:
Nicholas Nethercote 2020-02-05 14:33:08 +11:00
parent 6bf2cc2229
commit f840a955bd
4 changed files with 13 additions and 15 deletions

View file

@ -12,8 +12,7 @@ use syntax::ast;
use syntax::token::{self, Nonterminal};
use syntax::tokenstream::{self, TokenStream, TokenTree};
use std::borrow::Cow;
use std::path::Path;
use std::path::{Path, PathBuf};
use std::str;
use log::info;
@ -29,8 +28,8 @@ pub mod validate_attr;
pub mod config;
#[derive(Clone)]
pub struct Directory<'a> {
pub path: Cow<'a, Path>,
pub struct Directory {
pub path: PathBuf,
pub ownership: DirectoryOwnership,
}
@ -274,7 +273,7 @@ pub fn stream_to_parser<'a>(
pub fn stream_to_parser_with_base_dir<'a>(
sess: &'a ParseSess,
stream: TokenStream,
base_dir: Directory<'a>,
base_dir: Directory,
) -> Parser<'a> {
Parser::new(sess, stream, Some(base_dir), true, false, None)
}