From 2b9bd957dcdcb738ba162cc8e11a7f4480e04678 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Sun, 22 Jun 2014 05:49:08 +0900 Subject: [PATCH 01/10] language changes: bytes!() is now deprecated. --- src/encoding/codec/japanese.rs | 6 ++-- src/encoding/codec/simpchinese.rs | 49 +++++++++++++++---------------- src/encoding/types.rs | 8 ++--- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/encoding/codec/japanese.rs b/src/encoding/codec/japanese.rs index 42a6e9c..d757bb1 100644 --- a/src/encoding/codec/japanese.rs +++ b/src/encoding/codec/japanese.rs @@ -512,13 +512,13 @@ impl Encoder for ISO2022JPEncoder { let mut st = self.st; macro_rules! ensure_ASCII( - () => (if st != ASCII { output.write_bytes(bytes!("\x1b(B")); st = ASCII; }) + () => (if st != ASCII { output.write_bytes(b"\x1b(B"); st = ASCII; }) ) macro_rules! ensure_Katakana( - () => (if st != Katakana { output.write_bytes(bytes!("\x1b(I")); st = Katakana; }) + () => (if st != Katakana { output.write_bytes(b"\x1b(I"); st = Katakana; }) ) macro_rules! ensure_Lead( - () => (if st != Lead { output.write_bytes(bytes!("\x1b$B")); st = Lead; }) + () => (if st != Lead { output.write_bytes(b"\x1b$B"); st = Lead; }) ) for ((i,j), ch) in input.index_iter() { diff --git a/src/encoding/codec/simpchinese.rs b/src/encoding/codec/simpchinese.rs index adbf0c2..e4af507 100644 --- a/src/encoding/codec/simpchinese.rs +++ b/src/encoding/codec/simpchinese.rs @@ -298,10 +298,10 @@ impl Encoder for HZEncoder { let mut escaped = self.escaped; macro_rules! ensure_escaped( - () => (if !escaped { output.write_bytes(bytes!("~{")); escaped = true; }) + () => (if !escaped { output.write_bytes(b"~{"); escaped = true; }) ) macro_rules! ensure_unescaped( - () => (if escaped { output.write_bytes(bytes!("~}")); escaped = false; }) + () => (if escaped { output.write_bytes(b"~}"); escaped = false; }) ) for ((i,j), ch) in input.index_iter() { @@ -423,14 +423,13 @@ mod hz_tests { #[test] fn test_encoder_valid() { let mut e = HZEncoding.encoder(); - assert_feed_ok!(e, "A", "", bytes!("A")); - assert_feed_ok!(e, "BC", "", bytes!("BC")); - assert_feed_ok!(e, "", "", bytes!("")); - assert_feed_ok!(e, "\u4e2d\u534e\u4eba\u6c11\u5171\u548c\u56fd", "", - bytes!("~{VP;*HKCq92:M9z")); - assert_feed_ok!(e, "\uff21\uff22\uff23", "", bytes!("#A#B#C")); - assert_feed_ok!(e, "1\u20ac/m", "", bytes!("~}1~{\"c~}/m")); - assert_feed_ok!(e, "~<\u00a4~\u00a4>~", "", bytes!("~~<~{!h~}~~~{!h~}>~~")); + assert_feed_ok!(e, "A", "", b"A"); + assert_feed_ok!(e, "BC", "", b"BC"); + assert_feed_ok!(e, "", "", b""); + assert_feed_ok!(e, "\u4e2d\u534e\u4eba\u6c11\u5171\u548c\u56fd", "", b"~{VP;*HKCq92:M9z"); + assert_feed_ok!(e, "\uff21\uff22\uff23", "", b"#A#B#C"); + assert_feed_ok!(e, "1\u20ac/m", "", b"~}1~{\"c~}/m"); + assert_feed_ok!(e, "~<\u00a4~\u00a4>~", "", b"~~<~{!h~}~~~{!h~}>~~"); assert_finish_ok!(e, []); } @@ -447,20 +446,20 @@ mod hz_tests { #[test] fn test_decoder_valid() { let mut d = HZEncoding.decoder(); - assert_feed_ok!(d, bytes!("A"), bytes!(""), "A"); - assert_feed_ok!(d, bytes!("BC"), bytes!(""), "BC"); - assert_feed_ok!(d, bytes!("D~~E"), bytes!("~"), "D~E"); - assert_feed_ok!(d, bytes!("~F~\nG"), bytes!("~"), "~FG"); - assert_feed_ok!(d, bytes!(""), bytes!(""), ""); - assert_feed_ok!(d, bytes!("\nH"), bytes!("~"), "H"); - assert_feed_ok!(d, bytes!("{VP~}~{;*HKCq92:M9z"), bytes!(""), + assert_feed_ok!(d, b"A", b"", "A"); + assert_feed_ok!(d, b"BC", b"", "BC"); + assert_feed_ok!(d, b"D~~E", b"~", "D~E"); + assert_feed_ok!(d, b"~F~\nG", b"~", "~FG"); + assert_feed_ok!(d, b"", b"", ""); + assert_feed_ok!(d, b"\nH", b"~", "H"); + assert_feed_ok!(d, b"{VP~}~{;*HKCq92:M9z", b"", "\u4e2d\u534e\u4eba\u6c11\u5171\u548c\u56fd"); - assert_feed_ok!(d, bytes!(""), bytes!("#"), ""); - assert_feed_ok!(d, bytes!("A"), bytes!("~"), "\uff21"); - assert_feed_ok!(d, bytes!("~#B~~#C"), bytes!("~"), "~\uff22~\uff23"); - assert_feed_ok!(d, bytes!(""), bytes!(""), ""); - assert_feed_ok!(d, bytes!("\n#D~{#E~\n#F~{#G"), bytes!("~"), "#D\uff25#F\uff27"); - assert_feed_ok!(d, bytes!("}X~}YZ"), bytes!(""), "XYZ"); + assert_feed_ok!(d, b"", b"#", ""); + assert_feed_ok!(d, b"A", b"~", "\uff21"); + assert_feed_ok!(d, b"~#B~~#C", b"~", "~\uff22~\uff23"); + assert_feed_ok!(d, b"", b"", ""); + assert_feed_ok!(d, b"\n#D~{#E~\n#F~{#G", b"~", "#D\uff25#F\uff27"); + assert_feed_ok!(d, b"}X~}YZ", b"", "XYZ"); assert_finish_ok!(d, ""); } @@ -469,9 +468,9 @@ mod hz_tests { #[test] fn test_decoder_feed_after_finish() { let mut d = HZEncoding.decoder(); - assert_feed_ok!(d, bytes!("R;~{R;"), bytes!("R"), "R;\u4e00"); + assert_feed_ok!(d, b"R;~{R;", b"R", "R;\u4e00"); assert_finish_err!(d, ""); - assert_feed_ok!(d, bytes!("R;~{R;"), bytes!(""), "R;\u4e00"); + assert_feed_ok!(d, b"R;~{R;", b"", "R;\u4e00"); assert_finish_ok!(d, ""); } diff --git a/src/encoding/types.rs b/src/encoding/types.rs index 26dc141..5f76120 100644 --- a/src/encoding/types.rs +++ b/src/encoding/types.rs @@ -521,9 +521,9 @@ mod tests { &MyEncoding { flag: false, prohibit: '\u0080', prepend: "" }; assert_eq!(COMPAT.encode("Hello\u203d I'm fine.", EncodeNcrEscape), - Ok(Vec::from_slice(bytes!("Hello‽ I'm fine.")))); + Ok(Vec::from_slice(b"Hello‽ I'm fine."))); assert_eq!(INCOMPAT.encode("Hello\u203d I'm fine.", EncodeNcrEscape), - Ok(Vec::from_slice(bytes!("Hello‽ I'm fine.")))); + Ok(Vec::from_slice(b"Hello‽ I'm fine."))); } #[test] @@ -535,9 +535,9 @@ mod tests { // this should behave incorrectly as the encoding broke the assumption. assert_eq!(COMPAT.encode("Hello\u203d I'm fine.", EncodeNcrEscape), - Ok(Vec::from_slice(bytes!("He*l*l*o‽* *I*'*m* *f*i*n*e.")))); + Ok(Vec::from_slice(b"He*l*l*o‽* *I*'*m* *f*i*n*e."))); assert_eq!(INCOMPAT.encode("Hello\u203d I'm fine.", EncodeNcrEscape), - Ok(Vec::from_slice(bytes!("He*l*l*o*&*#*8*2*5*3*;* *I*'*m* *f*i*n*e.")))); + Ok(Vec::from_slice(b"He*l*l*o*&*#*8*2*5*3*;* *I*'*m* *f*i*n*e."))); } #[test] From 170facf0d513a7a88e733df3cf71c51a65f361bd Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Thu, 26 Jun 2014 16:41:42 +0900 Subject: [PATCH 02/10] language changes: integer type fallback is gone. --- src/encoding/codec/korean.rs | 10 ++++------ src/encoding/testutils.rs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/encoding/codec/korean.rs b/src/encoding/codec/korean.rs index 80d8f2c..88fdf05 100644 --- a/src/encoding/codec/korean.rs +++ b/src/encoding/codec/korean.rs @@ -122,6 +122,7 @@ ascii_compatible_stateful_decoder! { mod windows949_tests { extern crate test; use super::Windows949Encoding; + use std::iter::range_inclusive; use testutils; use types::*; @@ -170,8 +171,7 @@ mod windows949_tests { #[test] fn test_decoder_invalid_lone_lead_immediate_test_finish() { - for i in range(0x81, 0xff) { - let i = i as u8; + for i in range_inclusive(0x81u8, 0xfe) { let mut d = Windows949Encoding.decoder(); assert_feed_ok!(d, [], [i], ""); // wait for a trail assert_finish_err!(d, ""); @@ -186,8 +186,7 @@ mod windows949_tests { #[test] fn test_decoder_invalid_lone_lead_followed_by_space() { - for i in range(0x80, 0x100) { - let i = i as u8; + for i in range_inclusive(0x80u8, 0xff) { let mut d = Windows949Encoding.decoder(); assert_feed_err!(d, [], [i], [0x20], ""); assert_finish_ok!(d, ""); @@ -196,8 +195,7 @@ mod windows949_tests { #[test] fn test_decoder_invalid_lead_followed_by_invalid_trail() { - for i in range(0x80u16, 0x100) { - let i = i as u8; + for i in range_inclusive(0x80u8, 0xff) { let mut d = Windows949Encoding.decoder(); assert_feed_err!(d, [], [i], [0x80], ""); assert_feed_err!(d, [], [i], [0xff], ""); diff --git a/src/encoding/testutils.rs b/src/encoding/testutils.rs index 017143c..8e74231 100644 --- a/src/encoding/testutils.rs +++ b/src/encoding/testutils.rs @@ -65,8 +65,8 @@ macro_rules! assert_finish_err( let output = $this.test_norm_output(output); let (err, buf) = $this.test_finish(); let upto = err.map(|e| e.upto); - assert!(Some(0) == upto, - "raw_finish should return {}, but instead returned {}", Some(0), upto); + assert!(Some(0u) == upto, + "raw_finish should return {}, but instead returned {}", Some(0u), upto); assert!(output == buf.as_slice(), "raw_finish should push {}, but instead pushed {}", output, buf.as_slice()); }) @@ -178,12 +178,12 @@ macro_rules! single_byte_tests( () => ( mod tests { use super::{forward, backward}; + use std::iter::range_inclusive; use test; #[test] fn test_correct_table() { - for i in range(128, 256) { - let i = i as u8; + for i in range_inclusive(0x80u8, 0xff) { let j = forward(i); if j != 0xffff { assert_eq!(backward(j as u32), i); } } @@ -192,8 +192,8 @@ macro_rules! single_byte_tests( #[bench] fn bench_forward_sequential_128(bencher: &mut test::Bencher) { bencher.iter(|| { - for i in range(0x80, 0x100) { - test::black_box(forward(i as u8)); + for i in range_inclusive(0x80u8, 0xff) { + test::black_box(forward(i)); } }) } @@ -217,9 +217,9 @@ macro_rules! multi_byte_tests( (make shared tests and benches with dups = $dups:expr) => ( // internal macro #[test] fn test_correct_table() { + use std::iter::range_inclusive; static DUPS: &'static [u16] = &$dups; - for i in range(0u32, 0x10000) { - let i = i as u16; + for i in range_inclusive(0u16, 0xffff) { if DUPS.contains(&i) { continue; } let j = forward(i); if j != 0xffff { assert_eq!(backward(j), i); } From 21353629a1babf15089baf1917e814972e012bf8 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Sun, 29 Jun 2014 14:14:41 +0900 Subject: [PATCH 03/10] initial cargo support. --- .gitignore | 1 + Cargo.toml | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 Cargo.toml diff --git a/.gitignore b/.gitignore index be20a11..373a77c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ build Makefile *-test doc +target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..d815a6b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] + +name = "encoding" +version = "0.1.0" +authors = ["Kang Seonghoon "] + +[[lib]] + +name = "encoding" +path = "src/encoding/lib.rs" From 08d32146b410299f97dd954ad0c4301698320946 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Wed, 2 Jul 2014 15:48:45 +0900 Subject: [PATCH 04/10] language changes: no integer type inference. --- src/encoding/testutils.rs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/encoding/testutils.rs b/src/encoding/testutils.rs index 8e74231..5439272 100644 --- a/src/encoding/testutils.rs +++ b/src/encoding/testutils.rs @@ -271,9 +271,12 @@ macro_rules! multi_byte_tests( multi_byte_tests!(make shared tests and benches with dups = $dups) + static REMAP_MIN: u16 = $remap_min; + static REMAP_MAX: u16 = $remap_max; + #[test] fn test_correct_remapping() { - for i in range::($remap_min, $remap_max+1) { + for i in range::(REMAP_MIN, REMAP_MAX+1) { let j = forward(i); if j != 0xffff { let ii = backward_remapped(j); @@ -309,24 +312,33 @@ macro_rules! multi_byte_range_tests( use super::{forward, backward}; use test; + static MIN_KEY: u32 = $minkey; + static MAX_KEY: u32 = $maxkey; + static KEY_UBOUND: u32 = $keyubound; + static MIN_VALUE: u32 = $minvalue; + static MAX_VALUE: u32 = $maxvalue; + static VALUE_UBOUND: u32 = $valueubound; + #[test] + #[allow(type_limits)] fn test_no_failure() { - for i in range::(if $minkey>0 {$minkey-1} else {0}, $maxkey+2) { + for i in range::(if MIN_KEY>0 {MIN_KEY-1} else {0}, MAX_KEY+2) { forward(i); } - for j in range::(if $minvalue>0 {$minvalue-1} else {0}, $maxvalue+2) { + for j in range::(if MIN_VALUE>0 {MIN_VALUE-1} else {0}, MAX_VALUE+2) { backward(j); } } #[test] fn test_correct_table() { - for i in range::($minkey, $maxkey+2) { + for i in range::(MIN_KEY, MAX_KEY+2) { let j = forward(i); if j == 0xffffffff { continue; } let i_ = backward(j); if i_ == 0xffffffff { continue; } - assert!(i_ == i, "backward(forward({})) = backward({}) = {} != {}", i, j, i_, i); + assert!(i_ == i, + "backward(forward({})) = backward({}) = {} != {}", i, j, i_, i); } } @@ -338,7 +350,7 @@ macro_rules! multi_byte_range_tests( test::black_box(forward(i)); } start += 0x80; - if start >= $keyubound { start = 0; } + if start >= KEY_UBOUND { start = 0; } }) } @@ -350,7 +362,7 @@ macro_rules! multi_byte_range_tests( test::black_box(backward(i)); } start += 0x80; - if start >= $valueubound { start = 0; } + if start >= VALUE_UBOUND { start = 0; } }) } } From d64ef4541ef12c43a5366b8fb2e1d15222ae1c5e Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Mon, 7 Jul 2014 04:34:07 +0900 Subject: [PATCH 05/10] language changes: #[crate_id] -> #[crate_name], no dummy file is required. this also removes a `configure` script, it only set the VPATH and was not very useful. there is not much use case that VPATH is absolutely required anyway, and we will eventually switch to Cargo so it is the least concern. --- .gitignore | 2 -- Makefile | 39 +++++++++++++++++++++++++++++++++++++++ Makefile.in | 40 ---------------------------------------- configure | 5 ----- src/encoding/lib.rs | 2 +- 5 files changed, 40 insertions(+), 48 deletions(-) create mode 100644 Makefile delete mode 100644 Makefile.in delete mode 100755 configure diff --git a/.gitignore b/.gitignore index 373a77c..24984c8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,8 @@ *.dSYM *.dll *.rlib -*.dummy *.exe build -Makefile *-test doc target diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..367a019 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +CC ?= gcc +CXX ?= g++ +CXXFLAGS ?= +AR ?= ar +RUSTC ?= rustc +RUSTDOC ?= rustdoc +RUSTFLAGS ?= -O +EXT_DEPS ?= + +LIB_RS = src/encoding/lib.rs +LIB = ./libencoding.rlib +TEST_BIN = ./rustencoding-test +RUST_SRC = $(shell find src/encoding/. -type f -name '*.rs') + +.PHONY: all +all: $(LIB) + +$(LIB): $(LIB_RS) $(RUST_SRC) $(EXT_DEPS) + $(RUSTC) $(RUSTFLAGS) $< -o $@ + +$(TEST_BIN): $(LIB_RS) $(RUST_SRC) + $(RUSTC) $(RUSTFLAGS) $< -o $@ --test + +.PHONY: doctest +doctest: $(LIB_RS) $(LIB) + $(RUSTDOC) $< -L . --test + +.PHONY: check +check: doctest $(TEST_BIN) + $(TEST_BIN) + +.PHONY: doc +doc: $(LIB_RS) $(RUST_SRC) + $(RUSTDOC) $< + +.PHONY: clean +clean: + rm -f *.o *.a *.so *.dylib *.rlib *.dll *.exe *-test + diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index e245856..0000000 --- a/Makefile.in +++ /dev/null @@ -1,40 +0,0 @@ -VPATH=%VPATH% - -CC ?= gcc -CXX ?= g++ -CXXFLAGS ?= -AR ?= ar -RUSTC ?= rustc -RUSTDOC ?= rustdoc -RUSTFLAGS ?= -O -EXT_DEPS ?= - -LIB_RS = src/encoding/lib.rs -RUST_SRC = $(shell find $(VPATH)/src/encoding/. -type f -name '*.rs') - -.PHONY: all -all: libencoding.dummy - -libencoding.dummy: $(LIB_RS) $(RUST_SRC) $(EXT_DEPS) - $(RUSTC) $(RUSTFLAGS) $< --out-dir $(VPATH) - touch $@ - -rustencoding-test: $(LIB_RS) $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< -o $@ --test - -.PHONY: doctest -doctest: $(LIB_RS) $(RUST_SRC) libencoding.dummy - $(RUSTDOC) $< -L $(VPATH) --test - -.PHONY: check -check: doctest rustencoding-test - ./rustencoding-test - -.PHONY: doc -doc: $(LIB_RS) $(RUST_SRC) - $(RUSTDOC) $< - -.PHONY: clean -clean: - rm -f *.o *.a *.so *.dylib *.rlib *.dll *.dummy *.exe *-test - diff --git a/configure b/configure deleted file mode 100755 index ed6c06e..0000000 --- a/configure +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -SRCDIR="$(cd $(dirname $0) && pwd)" -sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile - diff --git a/src/encoding/lib.rs b/src/encoding/lib.rs index b154626..5bf3f87 100644 --- a/src/encoding/lib.rs +++ b/src/encoding/lib.rs @@ -171,7 +171,7 @@ Whenever in doubt, look at the source code and specifications for detailed expla */ -#![crate_id = "encoding#0.1.0"] +#![crate_name = "encoding"] #![crate_type = "lib"] #![comment = "Character encoding support for Rust"] #![license = "MIT"] From 7a8dfd643d4caf13ba00ce90dbb81765c3e927eb Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Mon, 7 Jul 2014 04:54:56 +0900 Subject: [PATCH 06/10] I forgot to update .travis.yml. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6883c15..3076ba7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ install: - (cd rust-nightly-x86_64-unknown-linux-gnu/ && sudo ./install.sh) # - sudo apt-get install rust-nightly script: - - ./configure - make check RUSTFLAGS= - make doc branches: From a29092087bf2e89aa2f098d89592767ae054e9f7 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Mon, 7 Jul 2014 05:39:51 +0900 Subject: [PATCH 07/10] well, rustc -o causes some issues with LTO. revert to --out-dir. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 367a019..4a33874 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,10 @@ RUST_SRC = $(shell find src/encoding/. -type f -name '*.rs') all: $(LIB) $(LIB): $(LIB_RS) $(RUST_SRC) $(EXT_DEPS) - $(RUSTC) $(RUSTFLAGS) $< -o $@ + $(RUSTC) $(RUSTFLAGS) $< --out-dir $(dir $@) $(TEST_BIN): $(LIB_RS) $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< -o $@ --test + $(RUSTC) $(RUSTFLAGS) $< --out-dir $(dir $@) --test .PHONY: doctest doctest: $(LIB_RS) $(LIB) From 4547a5df12aa3fceefe327f6b9f3101fee223e44 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Mon, 7 Jul 2014 17:53:29 +0900 Subject: [PATCH 08/10] oops, fixed `make check`. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4a33874..812f893 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ $(LIB): $(LIB_RS) $(RUST_SRC) $(EXT_DEPS) $(RUSTC) $(RUSTFLAGS) $< --out-dir $(dir $@) $(TEST_BIN): $(LIB_RS) $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< --out-dir $(dir $@) --test + $(RUSTC) $(RUSTFLAGS) $< -o $@ --test .PHONY: doctest doctest: $(LIB_RS) $(LIB) From c7a1a15fd547ffe7657f3ad1bab3d6a429a6e426 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Sun, 13 Jul 2014 00:20:36 +0900 Subject: [PATCH 09/10] updated .travis.yml. --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3076ba7..9ae7308 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,13 @@ env: global: - secure: WVwPS+infwl0FS4/zbCOzp8TZ2WOz6CgZPHgEw6+5IN4sqgabWSRH4rnxYQPDg5G1xxNlUslOmxJ9TvlFwXxaWutIg0FFfrev1qTvRVYuXsmN6pXwIQwmRP6tUKCPx/5oAefa/oQAIjzjILQ4qPVADxuxlIAycX5PCN29Jl1xIk= -#before_install: +before_install: # - yes | sudo add-apt-repository ppa:hansjorg/rust # - sudo apt-get update -install: +# - sudo apt-get install rust-nightly - curl -O http://static.rust-lang.org/dist/rust-nightly-x86_64-unknown-linux-gnu.tar.gz - tar xfz rust-nightly-x86_64-unknown-linux-gnu.tar.gz - - (cd rust-nightly-x86_64-unknown-linux-gnu/ && sudo ./install.sh) -# - sudo apt-get install rust-nightly + - (cd rust-nightly-x86_64-unknown-linux-gnu/ && sudo ./install.sh --prefix=/usr) script: - make check RUSTFLAGS= - make doc From 663c36f120f5dacd1df2a05ac5d5d11d36c7fa57 Mon Sep 17 00:00:00 2001 From: klutzy Date: Tue, 29 Jul 2014 14:17:45 +0900 Subject: [PATCH 10/10] Update for language changes --- src/encoding/codec/utf_8.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/encoding/codec/utf_8.rs b/src/encoding/codec/utf_8.rs index 877d97e..0a23b40 100644 --- a/src/encoding/codec/utf_8.rs +++ b/src/encoding/codec/utf_8.rs @@ -682,7 +682,7 @@ mod tests { let s = testutils::ASCII_TEXT.as_bytes(); bencher.bytes = s.len() as u64; bencher.iter(|| test::black_box({ - str::from_utf8_lossy(s) + String::from_utf8_lossy(s) })) } } @@ -739,7 +739,7 @@ mod tests { let s = testutils::KOREAN_TEXT.as_bytes(); bencher.bytes = s.len() as u64; bencher.iter(|| test::black_box({ - str::from_utf8_lossy(s) + String::from_utf8_lossy(s) })) } } @@ -784,7 +784,7 @@ mod tests { let s = testutils::INVALID_UTF8_TEXT; bencher.bytes = s.len() as u64; bencher.iter(|| test::black_box({ - str::from_utf8_lossy(s) + String::from_utf8_lossy(s) })) } } @@ -829,7 +829,7 @@ mod tests { let s = testutils::get_external_bench_data(); bencher.bytes = s.len() as u64; bencher.iter(|| test::black_box({ - str::from_utf8_lossy(s.as_slice()) + String::from_utf8_lossy(s.as_slice()) })) } }