-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Proc macro server #1681
base: spr/main/819109f5
Are you sure you want to change the base?
Add Proc macro server #1681
Conversation
commit-id:2ceebe3f
if stdin.read_line(&mut line).is_err() { | ||
eprintln!("Error occurred while reading from stdin"); | ||
|
||
break; | ||
} | ||
|
||
if line.is_empty() { | ||
continue; | ||
} | ||
|
||
let Ok(request) = serde_json::from_str(&line) else { | ||
eprintln!("Error occurred while deserializing request, used input:\n{line}"); | ||
|
||
break; | ||
}; | ||
|
||
if reader_sender.send(request).is_err() { | ||
eprintln!("Error occurred while sending request to worker threads"); | ||
|
||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of vertical noise here imo
if stdin.read_line(&mut line).is_err() { | |
eprintln!("Error occurred while reading from stdin"); | |
break; | |
} | |
if line.is_empty() { | |
continue; | |
} | |
let Ok(request) = serde_json::from_str(&line) else { | |
eprintln!("Error occurred while deserializing request, used input:\n{line}"); | |
break; | |
}; | |
if reader_sender.send(request).is_err() { | |
eprintln!("Error occurred while sending request to worker threads"); | |
break; | |
} | |
if stdin.read_line(&mut line).is_err() { | |
eprintln!("Error occurred while reading from stdin"); | |
break; | |
} | |
if line.is_empty() { | |
continue; | |
} | |
let Ok(request) = serde_json::from_str(&line) else { | |
eprintln!("Error occurred while deserializing request, used input:\n{line}"); | |
break; | |
}; | |
if reader_sender.send(request).is_err() { | |
eprintln!("Error occurred while sending request to worker threads"); | |
break; | |
} |
if stdin.read_line(&mut line).is_err() { | ||
eprintln!("Error occurred while reading from stdin"); | ||
|
||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- don't you want to build errors here & use anyhow contexts?
- you're logging to stderr here, so use
tracing
macros
use std::{ | ||
io::{BufRead, Write}, | ||
thread::JoinHandle, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use nested imports in our codebases
Stack:
ExpandInline
handler #1686ExpandDerive
handler #1685ExpandAttribute
handler #1684DefinedMacros
handler #1683ProcMacroHost
#1680proc-macro-server
command #1679cairo-lang-macro
fix null-byte panics #1677cairo-lang-macro
#1676