From 3db9fd5dab032b295be1f605a2ec514d41be34b4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 31 Mar 2018 15:18:42 -0700 Subject: [PATCH] This builds! --- src/xor.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/xor.rs b/src/xor.rs index 65fc6d9..a3bc413 100644 --- a/src/xor.rs +++ b/src/xor.rs @@ -5,17 +5,14 @@ use std::iter::{Iterator, Map, Zip}; // Bad, //} -pub type FixedXOR = Map, F>; - -pub trait FixedXORable { - fn fixed_xor(self, other: T) -> FixedXOR; +pub trait FixedXORable { + fn fixed_xor(self, other: T) -> Map, fn((u8, u8)) -> u8>; } -impl<'a, T, F> FixedXORable for T +impl<'a, T> FixedXORable for T where T: Iterator + 'a, - F: Fn((u8,u8)) -> u8 { - fn fixed_xor(self, other: T) -> FixedXOR { + fn fixed_xor(self, other: T) -> Map, fn((u8, u8)) -> u8> { fn xor(tup: (u8, u8)) -> u8 { tup.0 ^ tup.1 } self.zip(other).map(xor) }