Commit graph

26 commits

Author SHA1 Message Date
Ivan Tham 6c17473c7d Use branchless binary search to find_min_version
Constant search time and no unpredictable conditional branches
Benchmark results: 39 ns/iter -> 2 ns/iter (including multiple call)

Based on https://github.com/rust-lang/rust/pull/45333
Inspired by https://raw.githubusercontent.com/RustStudy/rust_daily_news/master/img/%E4%BA%8C%E7%BB%B4%E7%A0%81%E7%94%9F%E6%88%90.png
2019-07-06 23:24:26 +08:00
kennytm 049ebbefdb Fix clippy warnings. 2018-07-30 17:31:40 +08:00
kennytm 51dd9c4fa1 rustfmt. 2018-07-30 16:59:49 +08:00
kennytm 21efb6205e Rustfmt and clippy. 2017-11-07 22:12:18 +08:00
kennytm 0e1f5bd29a Relicense as Apache-2 + MIT.
Remove license footer (useless and awkward for dual licensing).
2016-06-08 00:30:47 +08:00
kennytm 5a7a1c65f0 Expose the maximum length for a EC-level via Bits::max_len. Fixes #3. 2016-06-05 01:00:02 +08:00
kennytm 38cfbc386f Enable benchmarking only with a feature. >:-( 2015-07-05 03:40:04 +08:00
kennytm fd0acd12ee Remove stability attributes. 2015-04-26 23:47:27 +08:00
kennytm 6ebf629ba4 rustup for beta. 2015-04-05 16:18:48 +08:00
kennytm da775325ed rustup. 2015-02-21 19:30:12 +08:00
kennytm 068707d312 rustup. 2015-02-06 19:42:58 +08:00
kennytm 18f9499918 rustup. 2015-01-25 17:51:54 +08:00
kennytm ed2e38031c rustup for 1.0.
* uint -> usize
* range(a, b) -> (a .. b)
* #[deriving] -> #[derive]
* [T, ..10] -> [T; 10]
* Iterator<X> -> Iterator<Item=X>
2015-01-10 21:53:34 +08:00
kennytm 91fdbeac11 Retry doc upload; Kill some deprecated functions. 2015-01-01 22:08:33 +08:00
kennytm d983500a58 rustup 2014-12-26 05:28:30 +08:00
kennytm ac5f0abaa2 Legal boilerplates. 2014-11-29 05:57:11 +08:00
kennytm a4ae80b1b7 rustup. Quantify all enums, and renamed (shortened) a few types. 2014-11-29 05:29:01 +08:00
kennytm acddb36406 rustup.
* Vec::reserve_additional -> Vec::reserve
* x[] -> &*x (as the former syntax is going away)
* XDeref -> Deref (as &T:Deref<T> is implemented)
* CloneableVector is gone? Move trait methods back into impl for now.
2014-11-11 08:36:43 +08:00
kennytm c008e97c8f Change all const back to static (Fixes #1.)
`const` are only for inline constants (similar to `#define`), not tables.
2014-10-24 16:48:25 +08:00
kennytm 59f28f0dd3 static -> const; change remaining of x.as_slice() to x[]. 2014-10-07 00:27:10 +08:00
kennytm bca618fe12 Rustup.
* Use ... instead of .. when matching a range, in preparation for
  rust-lang/rust#17584 (may not be complete).
* Use the new slicing syntax (a[], a[x..y]) if possible. (Currently
  String::as_slice() is blocked by rust-lang/rust#17502.)
* Change deprecated String::push_char() to String::push().
2014-09-28 00:59:20 +08:00
kennytm fa40eec147 rustup. 2014-09-24 16:02:46 +08:00
kennytm b7214af165 Rename the enum type Version to QrVersion.
Recent changes made enum names live in the type namespace as well. So we
need to rename to avoid name conflict.
2014-09-22 18:45:44 +08:00
kennytm 191796f759 Some standard rust functions are renamed. 2014-09-20 17:19:48 +08:00
kennytm 6b4d8aa366 Update doc. Refactor bits API. De-experimentalize everything. 2014-08-19 04:33:29 +08:00
kennytm 072cadec95 The 0.0.1 version which supports encoded to QR code and Micro QR code. 2014-08-19 03:26:49 +08:00