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

Permit unsized Write in format_document? #22

Closed
ArtemGr opened this issue Jul 1, 2015 · 2 comments
Closed

Permit unsized Write in format_document? #22

ArtemGr opened this issue Jul 1, 2015 · 2 comments

Comments

@ArtemGr
Copy link

ArtemGr commented Jul 1, 2015

Right now sxd_document::writer::format_document requires a Sized writer.
Using it with &mut Write produces a error:

src/crates/by_ad/../../by_ad.rs:901:3: 901:40 error: the trait `core::marker::Sized` is not implemented for the type `std::io::Write`
src/crates/by_ad/../../by_ad.rs:901   sxd_document::writer::format_document (&doc, out);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crates/by_ad/../../by_ad.rs:901:3: 901:40 `std::io::Write` does not have a constant size known at compile-time
src/crates/by_ad/../../by_ad.rs:901   sxd_document::writer::format_document (&doc, out);

(The code is along these lines:)

pub fn foo (out: &mut Write) {
    // ...
    sxd_document::writer::format_document (&doc, out);
}

Could you make the W unsized (?Sized)?

@shepmaster
Copy link
Owner

Can you give the unsized branch a shot, to see if it works with your case?

@ArtemGr
Copy link
Author

ArtemGr commented Jul 2, 2015

Yes, the branch works NP, thanks!

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

No branches or pull requests

2 participants