internal: a bit more of cwd safety for flycheck

This commit is contained in:
Aleksey Kladov 2021-07-17 17:40:13 +03:00
parent 8df38aa797
commit 8d8c26e6f5
16 changed files with 72 additions and 52 deletions

View file

@ -30,7 +30,7 @@ pub(crate) struct ProcMacroSrv {
impl ProcMacroSrv {
pub fn expand(&mut self, task: &ExpansionTask) -> Result<ExpansionResult, String> {
let expander = self.expander(&task.lib)?;
let expander = self.expander(task.lib.as_ref())?;
let mut prev_env = HashMap::new();
for (k, v) in &task.env {
@ -54,7 +54,7 @@ impl ProcMacroSrv {
}
pub fn list_macros(&mut self, task: &ListMacrosTask) -> Result<ListMacrosResult, String> {
let expander = self.expander(&task.lib)?;
let expander = self.expander(task.lib.as_ref())?;
Ok(ListMacrosResult { macros: expander.list_macros() })
}