Skip to content
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

Open
wants to merge 1 commit into
base: spr/main/819109f5
Choose a base branch
from
Open

Add Proc macro server #1681

wants to merge 1 commit into from

Conversation

commit-id:2ceebe3f
Comment on lines +28 to +48
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;
}
Copy link
Member

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

Suggested change
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;
}

Comment on lines +28 to +32
if stdin.read_line(&mut line).is_err() {
eprintln!("Error occurred while reading from stdin");

break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. don't you want to build errors here & use anyhow contexts?
  2. you're logging to stderr here, so use tracing macros

Comment on lines +3 to +6
use std::{
io::{BufRead, Write},
thread::JoinHandle,
};
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants