From 9f2adaad828c2fef2916a5c273d111639f10843d Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 26 Mar 2015 15:50:43 +0800 Subject: [PATCH] rustup. --- Cargo.toml | 2 +- src/ec.rs | 6 +++--- src/lib.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 34658ea..56e450c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "qrcode" description = "QR code encoder in Rust" license = "Apache-2.0" -version = "0.1.2" +version = "0.1.3" authors = ["kennytm "] keywords = ["qrcode"] repository = "https://github.com/kennytm/qrcode-rust" diff --git a/src/ec.rs b/src/ec.rs index 57aef76..89bc444 100644 --- a/src/ec.rs +++ b/src/ec.rs @@ -88,7 +88,7 @@ fn interleave>(blocks: &Vec) -> Vec { #[test] fn test_interleave() { - let res = interleave(&vec![b"1234".as_slice(), b"5678", b"abcdef", b"ghijkl"]); + let res = interleave(&vec![&b"1234"[..], b"5678", b"abcdef", b"ghijkl"]); assert_eq!(&*res, b"15ag26bh37ci48djekfl"); } @@ -147,9 +147,9 @@ mod construct_codewords_test { let msg = b"CUF\x86W&U\xc2w2\x06\x12\x06g&\xf6\xf6B\x07v\x86\xf2\x07&V\x16\xc6\xc7\x92\x06\xb6\xe6\xf7w2\x07v\x86W&R\x06\x86\x972\x07F\xf7vV\xc2\x06\x972\x10\xec\x11\xec\x11\xec\x11\xec"; let (blocks_vec, ec_vec) = construct_codewords(msg, Version::Normal(5), EcLevel::Q).unwrap(); assert_eq!(&*blocks_vec, - b"C\xf6\xb6FU\xf6\xe6\xf7FB\xf7v\x86\x07wVWv2\xc2&\x86\x07\x06U\xf2v\x97\xc2\x07\x862w&W\x102V&\xec\x06\x16R\x11\x12\xc6\x06\xec\x06\xc7\x86\x11g\x92\x97\xec&\x062\x11\x07\xec".as_slice()); + &b"C\xf6\xb6FU\xf6\xe6\xf7FB\xf7v\x86\x07wVWv2\xc2&\x86\x07\x06U\xf2v\x97\xc2\x07\x862w&W\x102V&\xec\x06\x16R\x11\x12\xc6\x06\xec\x06\xc7\x86\x11g\x92\x97\xec&\x062\x11\x07\xec"[..]); assert_eq!(&*ec_vec, - b"\xd5W\x94\xeb\xc7\xcct\x9f\x0b`\xb1\x05-<\xd4\xads\xcaL\x18\xf7\xb6\x85\x93\xf1|K;\xdf\x9d\xf2!\xe5\xc8\xeej\xf8\x86L(\x9a\x1b\xc3\xffu\x81\xe6\xac\x9a\xd1\xbdRo\x11\n\x02V\xa3l\x83\xa1\xa3\xf0 ox\xc0\xb2'\x85\x8d\xec".as_slice()); + &b"\xd5W\x94\xeb\xc7\xcct\x9f\x0b`\xb1\x05-<\xd4\xads\xcaL\x18\xf7\xb6\x85\x93\xf1|K;\xdf\x9d\xf2!\xe5\xc8\xeej\xf8\x86L(\x9a\x1b\xc3\xffu\x81\xe6\xac\x9a\xd1\xbdRo\x11\n\x02V\xa3l\x83\xa1\xa3\xf0 ox\xc0\xb2'\x85\x8d\xec"[..]); } } diff --git a/src/lib.rs b/src/lib.rs index 5e45610..824aae0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -190,7 +190,7 @@ impl QrCode { impl Index<(usize, usize)> for QrCode { type Output = bool; - fn index(&self, &(x, y): &(usize, usize)) -> &bool { + fn index(&self, (x, y): (usize, usize)) -> &bool { let index = y * self.width + x; &self.content[index] }