diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-02-20 17:41:23 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-02-20 17:41:23 +0100 |
| commit | 5255066d53ae14c8c936dcd7e879ae0fbb7b9f56 (patch) | |
| tree | dfda5d72cda5efef9e6f7d7d1a1c0e0efeaa9956 | |
| parent | 29229c400257834d1d59b2cf53e7ce8f5c8a23dd (diff) | |
Update pdf writer trait ♻
| -rw-r--r-- | src/pdf.rs | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -6,14 +6,13 @@ use pdf::{PdfWriter, Id, Rect, Version, DocumentCatalog, PageTree, Page, PageData, Resource, font::Type1Font, Text, Trailer}; -/// A type that is a sink for types that can be written conforming -/// to the _PDF_ format. -pub trait WritePdf<T> { - /// Write self into a byte sink, returning how many bytes were written. - fn write_pdf(&mut self, object: &T) -> io::Result<usize>; +/// A type that is a sink for documents that can be written in the _PDF_ format. +pub trait WritePdf { + /// Write a document into self, returning how many bytes were written. + fn write_pdf(&mut self, doc: &Document) -> io::Result<usize>; } -impl<W: Write> WritePdf<Document> for W { +impl<W: Write> WritePdf for W { fn write_pdf(&mut self, doc: &Document) -> io::Result<usize> { let mut writer = PdfWriter::new(self); |
