internal: improve compilation critical path a bit
This commit is contained in:
@@ -63,7 +63,7 @@ impl ProcMacroProcessExpander {
|
||||
macro_body: FlatTree::new(subtree),
|
||||
macro_name: self.name.to_string(),
|
||||
attributes: attr.map(FlatTree::new),
|
||||
lib: self.dylib_path.to_path_buf(),
|
||||
lib: self.dylib_path.to_path_buf().into(),
|
||||
env,
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ impl ProcMacroProcessSrv {
|
||||
&mut self,
|
||||
dylib_path: &AbsPath,
|
||||
) -> Result<Vec<(String, ProcMacroKind)>, tt::ExpansionError> {
|
||||
let task = ListMacrosTask { lib: dylib_path.to_path_buf() };
|
||||
let task = ListMacrosTask { lib: dylib_path.to_path_buf().into() };
|
||||
|
||||
let result: ListMacrosResult = self.send_task(Request::ListMacro(task))?;
|
||||
Ok(result.macros)
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
//! for separation of code responsibility.
|
||||
pub(crate) mod flat;
|
||||
|
||||
use paths::AbsPathBuf;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::rpc::flat::FlatTree;
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize)]
|
||||
pub struct ListMacrosTask {
|
||||
pub lib: AbsPathBuf,
|
||||
pub lib: PathBuf,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Debug, Serialize, Deserialize)]
|
||||
@@ -46,7 +47,7 @@ pub struct ExpansionTask {
|
||||
/// Possible attributes for the attribute-like macros.
|
||||
pub attributes: Option<FlatTree>,
|
||||
|
||||
pub lib: AbsPathBuf,
|
||||
pub lib: PathBuf,
|
||||
|
||||
/// Environment variables to set during macro expansion.
|
||||
pub env: Vec<(String, String)>,
|
||||
@@ -93,7 +94,7 @@ mod tests {
|
||||
macro_body: FlatTree::new(&tt),
|
||||
macro_name: Default::default(),
|
||||
attributes: None,
|
||||
lib: AbsPathBuf::assert(std::env::current_dir().unwrap()),
|
||||
lib: std::env::current_dir().unwrap(),
|
||||
env: Default::default(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user