Commit Graph

31 Commits

Author SHA1 Message Date
S0AndS0 432fd9443e WIP: Add the "unwrap_used" lint.
> Check `unwrap_used` section of Clippy documentation for details;
>
>   https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

This adds the following Clippy configuration to crates;

    #![deny(clippy::unwrap_used)]

**Warning** while tests and compiler do not show any errors, the submitted
changes are very much a Work In Progress and mistakes may have been made. Check

    https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/67

Merge Request thread for more details.
2021-08-24 15:31:31 -07:00
Nick Mathewson fe5d826942 Merge remote-tracking branch 'origin/mr/60' 2021-08-18 08:53:11 -04:00
S0AndS0 484cc24856 Add the "implicit_clone" lint.
> Check `implicit_clone` section of Clippy documentation for details;
>
>   https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone

This adds, and addresses, the following Clippy configuration to crates;

    #![deny(clippy::implicit_clone)]

And moves related line within `maint/add_warning.py` file. My intent is to
mitigate extra edits after merging, so please let me know if I need to do this
last bit differently.
2021-08-17 11:49:39 -07:00
S0AndS0 b5a58f5871 Add the "missing_panics_doc" lint.
> Check `missing_panics_doc` section of Clippy documentation for details;
>
>   https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

This adds the following Clippy configuration to crates;

    #![deny(clippy::missing_panics_doc)]

And adds necessary doc-comments to methods that may panic.
2021-08-13 15:11:04 -07:00
Nick Mathewson 9c6dd27ca1 Use add_warnings.py for clippy::cast_lossless 2021-08-13 11:36:14 -04:00
Nick Mathewson 7af73d4e81 Merge remote-tracking branch 'origin/mr/59' 2021-08-13 11:32:59 -04:00
Nick Mathewson 8e00ed6f2e Improve test coverage on tor-units 2021-08-13 09:27:00 -04:00
S0AndS0 657e7b2246 Add the "cast_lossless" lint.
> Check `cast_lossless` section of Clippy documentation for details;
>
>   https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless

This adds the following Clippy configuration to crates;

    #![deny(clippy::cast_lossless)]

And applies suggested Clippy and `cargo fmt` fixes.
2021-08-12 17:25:15 -07:00
Nick Mathewson b6e07ce5bf Fix documentation link issues. 2021-08-12 11:02:50 -04:00
Nick Mathewson cb9319c468 Use real network parameters to set unused-circ timeouts. 2021-08-10 10:46:31 -04:00
Nick Mathewson 79d9eac58c Add unnecessary_wraps to the big warning list. 2021-08-06 16:20:37 -04:00
rls 51d91508f7 Fix typos and other spelling mistakes 2021-07-31 18:02:35 +02:00
Nick Mathewson e5e46e75fd Implement TryInto<u64> for BoundedInt32 2021-07-19 12:25:26 -04:00
Nick Mathewson 1c21295d19 Merge remote-tracking branch 'origin/mr/34' 2021-06-27 14:30:49 -04:00
Nick Mathewson 920539bb05 Missing fields in tor-units/Cargo.toml. 2021-06-24 07:20:40 -04:00
Nick Mathewson b774360755 Remove "publish = false" 2021-06-24 07:04:26 -04:00
YUAN LYU 92dbf20a76 Add clippy warn needless pass by value 2021-06-21 23:27:19 -04:00
YUAN LYU b830e81b7f Add clippy warn needless borrow 2021-06-21 21:34:40 -04:00
Nick Mathewson 2102d2e2b5 Add noop_method_call warning.
This would have saved ahf and me a lot of confusion in debugging a
situation where we were cloning a reference of a type that didn't
implement Clone.
2021-05-27 14:32:29 -04:00
Nick Mathewson 7f681ac824 Use the "typos" tool to fix some spelling 2021-05-26 19:18:35 -04:00
Nick Mathewson d05d9ad9e7 Use thiserror to simplify tor-units 2021-05-26 10:46:17 -04:00
Nick Mathewson 406643474b Add a Display test in tor-units 2021-05-26 10:46:17 -04:00
Nick Mathewson 745c90e92c Enable cargo_common_metadata warning. 2021-05-25 15:42:47 -04:00
Nick Mathewson cf59e9be77 Add automatically generated README.md files to each crate. 2021-05-25 15:41:23 -04:00
Nick Mathewson 4f98e17d12 Remove extern crate declarations.
They're no longer needed for macro use in Rust 2018.
2021-05-25 11:27:31 -04:00
Nick Mathewson e670b0e939 Use "use" in tor_netdir, remove needless qualifications. 2021-05-25 11:25:41 -04:00
Nick Mathewson 88e711b282 Re-add a percentage type wrapper.
It turns out that when we don't have a percentage type associated
with a value, it is far too easy to forget to divide by 100 before
using it as a fraction.
2021-05-25 11:21:11 -04:00
Nick Mathewson df36cfafb0 tor-units: warn about uninhabited types and panics 2021-05-25 10:50:06 -04:00
Nick Mathewson 21a7012451 Tweaks docs and style in tor-units. 2021-05-25 10:33:33 -04:00
Nick Mathewson f83b167c30 Apply our suite of clippy warnings to tor-units. 2021-05-25 09:51:28 -04:00
Nick Mathewson e8214d1df1 Use macros and types to improve handling of Netdir parameters.
(Squashed from typed-netdir-params)
2021-05-25 09:16:59 -04:00