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

Allow printing a prettytable to anything that implements Write #17

Merged
merged 1 commit into from
Sep 10, 2023

Conversation

asomers
Copy link
Contributor

@asomers asomers commented Sep 10, 2023

For example, stderr instead of stdout.

Depends on phsym/prettytable-rs#156

@romankoblov romankoblov merged commit fc2abc8 into oli-obk:master Sep 10, 2023
@romankoblov
Copy link
Collaborator

Fails on publish:

error[E0277]: the trait bound `W: term::Terminal` is not satisfied
   --> src/text.rs:413:26
    |
413 |         table.print_term(f)
    |               ---------- ^ the trait `term::Terminal` is not implemented for `W`
    |               |
    |               required by a bound introduced by this call
    |
note: required by a bound in `prettytable::Table::print_term`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prettytable-rs-0.10.0/src/lib.rs:373:26
    |
373 |     pub fn print_term<T: Terminal + ?Sized>(&self, out: &mut T) -> Result<usize, Error> {
    |                          ^^^^^^^^ required by this bound in `Table::print_term`
help: consider further restricting this bound
    |
410 |         where W: std::io::Write + std::io::IsTerminal + term::Terminal
    |                                                       ++++++++++++++++

@asomers
Copy link
Contributor Author

asomers commented Sep 10, 2023

What was the command that failed? And BTW I wouldn't expect cargo publish to work since this PR adds a [patch.crates-io] section to Cargo.toml.

@romankoblov
Copy link
Collaborator

cargo publish fails, cargo build works. Why specific patch then?

@romankoblov
Copy link
Collaborator

Oh, you changed prettytable too. Ok, can you then send another PR when this released, so I can publish new version?

@asomers
Copy link
Contributor Author

asomers commented Sep 10, 2023

Absolutely.

@asomers asomers deleted the write_prettytable branch September 10, 2023 17:17
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.

None yet

2 participants