aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_api
diff options
context:
space:
mode:
Diffstat (limited to 'crates/proc_macro_api')
-rw-r--r--crates/proc_macro_api/src/msg.rs2
-rw-r--r--crates/proc_macro_api/src/process.rs4
2 files changed, 2 insertions, 4 deletions
diff --git a/crates/proc_macro_api/src/msg.rs b/crates/proc_macro_api/src/msg.rs
index 14eed4289..899895578 100644
--- a/crates/proc_macro_api/src/msg.rs
+++ b/crates/proc_macro_api/src/msg.rs
@@ -59,7 +59,7 @@ pub trait Message: Serialize + DeserializeOwned {
59 Ok(match read_json(inp, buf)? { 59 Ok(match read_json(inp, buf)? {
60 None => None, 60 None => None,
61 Some(text) => { 61 Some(text) => {
62 let mut deserializer = serde_json::Deserializer::from_str(&text); 62 let mut deserializer = serde_json::Deserializer::from_str(text);
63 // Note that some proc-macro generate very deep syntax tree 63 // Note that some proc-macro generate very deep syntax tree
64 // We have to disable the current limit of serde here 64 // We have to disable the current limit of serde here
65 deserializer.disable_recursion_limit(); 65 deserializer.disable_recursion_limit();
diff --git a/crates/proc_macro_api/src/process.rs b/crates/proc_macro_api/src/process.rs
index 99d05aef3..38eac6c17 100644
--- a/crates/proc_macro_api/src/process.rs
+++ b/crates/proc_macro_api/src/process.rs
@@ -76,9 +76,7 @@ impl ProcMacroProcessSrv {
76 .map_err(|_| tt::ExpansionError::Unknown("proc macro server crashed".into()))?; 76 .map_err(|_| tt::ExpansionError::Unknown("proc macro server crashed".into()))?;
77 77
78 match res { 78 match res {
79 Some(Response::Error(err)) => { 79 Some(Response::Error(err)) => Err(tt::ExpansionError::ExpansionError(err.message)),
80 return Err(tt::ExpansionError::ExpansionError(err.message));
81 }
82 Some(res) => Ok(res.try_into().map_err(|err| { 80 Some(res) => Ok(res.try_into().map_err(|err| {
83 tt::ExpansionError::Unknown(format!("Fail to get response, reason : {:#?} ", err)) 81 tt::ExpansionError::Unknown(format!("Fail to get response, reason : {:#?} ", err))
84 })?), 82 })?),