|  | @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
 | 
	
		
			
				|  |  |  use std::collections::HashMap;
 | 
	
		
			
				|  |  |  use std::io::{Read, Seek, Write};
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -const CURRENT_VERSION: &'static str = "0";
 | 
	
		
			
				|  |  | +const CURRENT_VERSION: &str = "0";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  #[derive(Debug, Clone, Copy)]
 | 
	
		
			
				|  |  |  pub enum StitchType {
 | 
	
	
		
			
				|  | @@ -16,11 +16,11 @@ pub enum StitchType {
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  impl StitchType {
 | 
	
		
			
				|  |  | -    fn to_u8(&self) -> u8 {
 | 
	
		
			
				|  |  | +    fn to_u8(self) -> u8 {
 | 
	
		
			
				|  |  |          match self {
 | 
	
		
			
				|  |  | -            StitchType::Normal => 'x' as u8,
 | 
	
		
			
				|  |  | -            StitchType::HalfUp => '/' as u8,
 | 
	
		
			
				|  |  | -            StitchType::HalfDown => '\\' as u8,
 | 
	
		
			
				|  |  | +            StitchType::Normal => b'x',
 | 
	
		
			
				|  |  | +            StitchType::HalfUp => b'/',
 | 
	
		
			
				|  |  | +            StitchType::HalfDown => b'\\',
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 | 
	
	
		
			
				|  | @@ -76,14 +76,10 @@ impl ThymeFile {
 | 
	
		
			
				|  |  |          let payload = image
 | 
	
		
			
				|  |  |              .iter()
 | 
	
		
			
				|  |  |              .map(|(_idx, pixel)| {
 | 
	
		
			
				|  |  | -                if let Some(color) = lookup.get(&pixel) {
 | 
	
		
			
				|  |  | -                    Some(Stitch {
 | 
	
		
			
				|  |  | -                        color: *color,
 | 
	
		
			
				|  |  | -                        typ: StitchType::Normal,
 | 
	
		
			
				|  |  | -                    })
 | 
	
		
			
				|  |  | -                } else {
 | 
	
		
			
				|  |  | -                    None
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | +                lookup.get(&pixel).map(|color| Stitch {
 | 
	
		
			
				|  |  | +                    color: *color,
 | 
	
		
			
				|  |  | +                    typ: StitchType::Normal,
 | 
	
		
			
				|  |  | +                })
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |              .collect();
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -209,14 +205,15 @@ impl ThymeFile {
 | 
	
		
			
				|  |  |      fn json_stitches(&self) -> Vec<Option<IntermediateStitch>> {
 | 
	
		
			
				|  |  |          self.payload
 | 
	
		
			
				|  |  |              .iter()
 | 
	
		
			
				|  |  | -            .map(|stitch| match stitch {
 | 
	
		
			
				|  |  | -                Some(s) => Some(IntermediateStitch(s.typ.to_u8(), s.color.idx)),
 | 
	
		
			
				|  |  | -                None => None,
 | 
	
		
			
				|  |  | +            .map(|stitch| {
 | 
	
		
			
				|  |  | +                stitch
 | 
	
		
			
				|  |  | +                    .as_ref()
 | 
	
		
			
				|  |  | +                    .map(|s| IntermediateStitch(s.typ.to_u8(), s.color.idx))
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |              .collect()
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    pub fn iter<'a>(&'a self) -> ThymeImageIterator<'a> {
 | 
	
		
			
				|  |  | +    pub fn iter(&self) -> ThymeImageIterator<'_> {
 | 
	
		
			
				|  |  |          ThymeImageIterator {
 | 
	
		
			
				|  |  |              palette: &self.palette,
 | 
	
		
			
				|  |  |              x: 0,
 |