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
dyn Write support removed? #111
Comments
Yes, I simplified the output parameter from a rather complex trait bound that boild down to "mut any pointer mut that implements Write" to just I mainly call the templates writing to a |
yes, I'm writing to a compressed stream that has a complex type. |
Ah, yes, there might be times when using a |
However, just adding |
I think #107 also inhibits calling template functions on the pub struct ResponsiveImage<'asset> {
asset: &'asset Asset,
size: Resize,
}
impl<'asset> ResponsiveImage<'asset> {
pub fn new(asset: &'asset Asset, size: Resize) -> Self {
ResponsiveImage { asset, size }
}
}
impl ToHtml for ResponsiveImage<'_> {
fn to_html(&self, out: &mut dyn Write) -> io::Result<()> {
let non_retina = self.asset.thumbnail_url(self.size);
let retina = self.asset.thumbnail_url(self.size * 2);
templates::responsive_image(out, non_retina, retina)
}
} Originally I was manually making
|
I've used to pass
&mut dyn Write
to the templates, but it does not compile any more due to<W>
bound on template functions lacking?Sized
.The text was updated successfully, but these errors were encountered: