pnm decoding and encoding
Diffstat (limited to 'src/ppm.rs')
-rw-r--r--src/ppm.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ppm.rs b/src/ppm.rs
index f57a3d9..3b10c30 100644
--- a/src/ppm.rs
+++ b/src/ppm.rs
@@ -131,11 +131,8 @@ pub mod raw {
o.push(b' ');
encodeu32(x.height(), &mut o);
o.put(*b" 255\n");
- for &x in *x.buffer() {
- o.push(x)
- }
-
- o.sub_ptr(out)
+ o.copy_from(x.buffer().as_ptr(), x.len());
+ o.sub_ptr(out) + x.len()
}
#[doc = include_str!("decode_body_into.md")]