-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support having a generic writer instead of a termcolor StandardStream #4178
Conversation
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.
Looks good!
Cargo will print to stdout (via println!
) in a location or two but they're all relatively minor (like cargo install --list
) that I think rls and other clients won't hit.
src/cargo/core/shell.rs
Outdated
write!(err, " {}\n", message)?; | ||
Ok(()) | ||
} | ||
ShellOut::Write(_) => unimplemented!(), |
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.
This'll cause panics when used from the rls, right?
src/cargo/core/shell.rs
Outdated
fn as_write(&mut self) -> &mut Write { | ||
match *self { | ||
ShellOut::Stream(ref mut err, _) => err, | ||
ShellOut::Write(_) => unimplemented!(), |
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.
(same as above)
This is requied by the RLS (and presumably any other client who wants to use Cargo as a lib and redirect output)
Whoops, sorry about that. Now with actual implementations. |
@bors: r+ |
📌 Commit 6f45cb6 has been approved by |
Support having a generic writer instead of a termcolor StandardStream This is requied by the RLS (and presumably any other client who wants to use Cargo as a lib and redirect output) r? @alexcrichton
☀️ Test successful - status-appveyor, status-travis |
This is requied by the RLS (and presumably any other client who wants to use Cargo as a lib and redirect output)
r? @alexcrichton