Skip to content

write! and the like should probably require a Writer implementation #21615

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

Closed
SiegeLord opened this issue Jan 25, 2015 · 2 comments
Closed

write! and the like should probably require a Writer implementation #21615

SiegeLord opened this issue Jan 25, 2015 · 2 comments

Comments

@SiegeLord
Copy link
Contributor

Right now it just calls a method named write_fmt. This duck typing might lead to confusing error messages, and contradicts the documentation of the macro.

@huonw huonw added the A-libs label Jan 25, 2015
@alexcrichton
Copy link
Member

Unfortunately this isn't currently possible (we tried to do this awhile ago). There are two contexts in which the write! macro is primarily called:

  1. When using io::Writer
  2. When using fmt::Formatter or fmt::Writer

Unfortunately these two cases call different write_fmt methods (different traits), so this will not necessarily be easy to resolve.

@alexcrichton
Copy link
Member

Closing due to my previous comment, and also that this is stable now.

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

No branches or pull requests

3 participants