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

Support having a generic writer instead of a termcolor StandardStream #4178

Merged
merged 1 commit into from
Jun 17, 2017

Conversation

nrc
Copy link
Member

@nrc nrc commented Jun 16, 2017

This is requied by the RLS (and presumably any other client who wants to use Cargo as a lib and redirect output)

r? @alexcrichton

Copy link
Member

@alexcrichton alexcrichton left a 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.

write!(err, " {}\n", message)?;
Ok(())
}
ShellOut::Write(_) => unimplemented!(),
Copy link
Member

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?

fn as_write(&mut self) -> &mut Write {
match *self {
ShellOut::Stream(ref mut err, _) => err,
ShellOut::Write(_) => unimplemented!(),
Copy link
Member

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)
@nrc
Copy link
Member Author

nrc commented Jun 17, 2017

Whoops, sorry about that. Now with actual implementations.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jun 17, 2017

📌 Commit 6f45cb6 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jun 17, 2017

⌛ Testing commit 6f45cb6 with merge c339214...

bors added a commit that referenced this pull request Jun 17, 2017
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
@bors
Copy link
Contributor

bors commented Jun 17, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing c339214 to master...

@bors bors merged commit 6f45cb6 into rust-lang:master Jun 17, 2017
@ehuss ehuss added this to the 1.20.0 milestone Feb 6, 2022
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.

4 participants