Commit Graph

464 Commits

Author SHA1 Message Date
Josh Stone d561e4b702 Merge pull request #262 from Xaeroxe23/master
Add clamp function
2017-02-09 14:17:14 -08:00
Jacob Kiesel c78a48fd35 Improve documentation comments
Remove passive voice from documentation comments.
2017-02-08 15:10:01 -07:00
Jacob Kiesel 17665ec50d Update lib.rs
Make assert debug error more accurate.
2017-02-07 15:03:00 -07:00
Jacob Kiesel f8dcec366b Made requested changes. 2017-02-07 13:02:32 -07:00
Jacob Kiesel 182e08a091 Add inline attribute 2017-02-07 10:49:28 -07:00
Jacob Kiesel b346f9c2df Add a new line for improved formatting. 2017-02-07 10:18:23 -07:00
Jacob Kiesel a5445b7619 Adding documentation comments 2017-02-07 10:18:23 -07:00
Jacob Kiesel 07ff5b62b9 Changing to >= and <= as it's a slight optimization 2017-02-07 09:52:23 -07:00
Jacob Kiesel 28633b7e6d Add clamp function 2017-02-07 09:48:34 -07:00
Josh Stone 817ab00f64 Merge pull request #256 from nwin/add-wrapping-traits
Added traits for wrapping arithmetics.
2017-02-04 21:47:53 -08:00
nwin 58b7da46d2 Added tests. 2017-02-04 10:42:12 +01:00
Josh Stone ba54797d60 Merge pull request #258 from frewsxcv/patch-1
Add doc example for `num_traits::Num::from_str_radix`.
2017-01-31 09:37:30 -08:00
Corey Farwell 19109883de Add doc example for `num_traits::Num::from_str_radix`. 2017-01-30 23:42:27 -05:00
nwin 450c0e2760 Correct typos. 2017-01-26 21:12:27 +01:00
nwin ee9d474243 Ensure compatibility with Rust 1.0.0. 2017-01-22 10:13:50 +01:00
nwin d25f53056d Added traits for wrapping arithmetics.
Added `Wrapping` traits for the most common operations. Similar to the already present `Checked` traits.
2017-01-22 09:45:35 +01:00
Josh Stone 74f1e26f62 macros: bump to 0.1.37 2017-01-11 16:52:06 -08:00
Josh Stone 75372c0639 derive: bump to 0.1.39 2017-01-11 16:51:14 -08:00
Homu bda31b1a33 Auto merge of #252 - est31:master, r=cuviper
macros 1.1 is now stable

Fixes #251. Also includes a patch to get the tests working again.
2017-01-08 08:14:45 +09:00
est31 9aced4066e derive: custom derive is now stable 2017-01-07 23:51:55 +01:00
est31 c742cf9aec derive: use latest compiletest_rs crate
Version 2.2 was not compiling any more: https://github.com/laumann/compiletest-rs/issues/51
2017-01-07 23:51:21 +01:00
Homu a4faeeffc4 Auto merge of #250 - andersk:should_panic, r=cuviper
rational: test_recip_fail: Correct should_panic syntax

Fixes this warning with rustc nightly:

```
warning: attribute must be of the form: `#[should_panic]` or `#[should_panic(expected = "error message")]`
    --> rational/src/lib.rs:1051:7
     |
1051 |     #[should_panic = "== 0"]
     |       ^^^^^^^^^^^^^^^^^^^^^
     |
     = note: Errors in this attribute were erroneously allowed and will become a hard error in a future release.
```
2017-01-07 06:26:59 +09:00
Anders Kaseorg fd44a86866 rational: test_recip_fail: Correct should_panic syntax
Fixes this warning:

warning: attribute must be of the form: `#[should_panic]` or `#[should_panic(expected = "error message")]`
    --> rational/src/lib.rs:1051:7
     |
1051 |     #[should_panic = "== 0"]
     |       ^^^^^^^^^^^^^^^^^^^^^
     |
     = note: Errors in this attribute were erroneously allowed and will become a hard error in a future release.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2017-01-06 15:05:01 -05:00
Homu d468177eee Auto merge of #248 - dnsl48:ratio_into_pair, r=cuviper
rational: Into<(T,T)> implementation

Right now it appears impossible to get integers without cloning them. Converting into a pair can be a cheap and easy way to extract the data.
2016-12-10 09:47:59 +09:00
dnsl48 9d7ab663b1 From<(T,T)> implementation 2016-12-10 09:19:02 +13:00
dnsl48 70da35dff5 Into<(T,T)> implementation 2016-12-10 08:39:06 +13:00
Homu 7db32a4ecd Auto merge of #246 - cuviper:complex-eq, r=hauleth
complex: derive Eq

Fixes #245.
2016-12-06 18:48:42 +09:00
Josh Stone 5531031252 complex: derive Eq
Fixes #245.
2016-12-05 23:11:40 -08:00
Homu dc8c8fc3f6 Auto merge of #244 - wictory:master, r=cuviper
Added trait From<T> for Ratio<T> where T: Clone + Integer

Hi!

So I thought that this kind of trait would be useful when one wants to write code which should be generic over different types of numbers.
2016-12-03 07:14:51 +09:00
Homu a63bbc916f Auto merge of #243 - cuviper:intern-macros, r=hauleth
macros: update string interning

None
2016-12-03 07:08:30 +09:00
Wictor Lund 4bdad38eee Added test for trait From<T> for Ratio<T> where T: Clone + Integer. 2016-12-01 22:07:03 +02:00
Wictor Lund de91d5d9e3 Added trait From<T> for Ratio<T> where T: Clone + Integer 2016-12-01 21:38:53 +02:00
Josh Stone be61427d03 derive: bump to 0.1.38 2016-11-28 09:46:18 -08:00
Josh Stone 7ebef5bbe6 macros: update string interning 2016-11-28 09:41:18 -08:00
Josh Stone d7cbdb509c Merge pull request #242 from rust-num/feat/do-not-duplicate-enum-definition
Fix code duplication error

(Overriding a CI failure due to `num-macros`.)
2016-11-28 09:39:36 -08:00
Łukasz Jan Niemier 20243f5baa
fix(num_derive): code duplication error
Fixes #240
2016-11-27 19:31:33 +01:00
Homu 8489f0c388 Auto merge of #239 - bluss:doc-root-url, r=cuviper
Add doc(html_root_url) and other doc attrs to each crate

Also update to use https instead of http. This avoids mixed content
degradation on docs.rs.

The doc root URLs are correct as they are, the URL does not include the
crate name itself.
2016-11-05 02:33:34 +09:00
bluss ff2a350e98 Use the integer32 playground 2016-11-02 19:51:10 +01:00
bluss e4a6956e5a Add doc(html_root_url) and other doc attrs to each crate
Also update to use https instead of http. This avois mixed content
degradation on docs.rs.

The doc root URLs are correct as they are, the URL does not include the
crate name itself.
2016-11-01 02:14:23 +01:00
Homu 938ec63c95 Auto merge of #238 - bluss:fix-mut, r=cuviper
traits: Remove pattern in trait's method signature

This use of `mut` was nonsensical for now, but is proposed to be
disallowed by rustc in the future (as a bugfix).

See rust-lang/rust/pull/37378 for context.
2016-10-25 08:05:35 +09:00
bluss 96e96ef762 Remove pattern in trait's method signature
This use of `mut` was nonsensical for now, but is proposed to be
disallowed by rustc in the future (as a bugfix in Rust).
2016-10-25 00:42:44 +02:00
Josh Stone 8d4b7b3a8d derive: bump to 0.1.37 2016-10-14 20:52:24 -07:00
Homu f2aecb591c Auto merge of #236 - cuviper:proc-macro, r=hauleth
derive: update to proc-macro
2016-10-14 03:59:48 +09:00
Josh Stone 97551ade5b derive: update to proc-macro 2016-10-13 10:31:49 -07:00
Homu b6db1eace9 Auto merge of #235 - matklad:minor-corrections, r=cuviper
Minor, style and comment typo

Just a couple of super minor cosmetic corrections.
2016-10-06 01:30:42 +09:00
Aleksey Kladov ec6ce78458 Minor, style and comment typo 2016-10-05 18:47:30 +03:00
Josh Stone f25a3bd51d 0.1.36 bump for num, traits, macros, and the new derive 2016-09-29 23:31:23 -07:00
Homu 019c136b8c Auto merge of #228 - rust-num:fix/num-macros, r=cuviper
Fix `num-macros` `FromPrimitive` implementation

Current solution follow syntax proposed in rust-lang/rfcs#1681.

Tracking issue rust-lang/rust#35900

Close #227

Code broken after change:

- [ ] https://github.com/kdar/gameboy-rs
- [ ] https://github.com/lemonrock/mbedtls
- [ ] https://github.com/timorantalaiho/kelaa
- [ ] https://github.com/dylanede/cef-rs
- [ ] https://github.com/klutzy/aheui-llvm
- [ ] https://github.com/pcwalton/rust-media
- [ ] https://github.com/PistonDevelopers/hematite_server
2016-09-30 14:58:47 +09:00
Łukasz Jan Niemier b7e64074b2
Add new crate num-derive as an new replacement for num-macro 2016-09-28 13:33:13 +02:00
Łukasz Jan Niemier 0c89b893a9
Add compiletest crate to test against invalid derivations 2016-09-27 11:18:27 +02:00