Skip to content

Commit

Permalink
Harden Clippy lints and forbid unsafe_code
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Jul 9, 2024
1 parent e8b0310 commit 5ecc5d0
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
25 changes: 25 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Project configuration for Clippy Rust code linter.
# See full lints list at:
# https://rust-lang.github.io/rust-clippy/master/index.html

standard-macro-braces = [
{ name = "assert", brace = "(" },
{ name = "assert_eq", brace = "(" },
{ name = "assert_ne", brace = "(" },
{ name = "debug_assert", brace = "(" },
{ name = "debug_assert_eq", brace = "(" },
{ name = "debug_assert_ne", brace = "(" },
{ name = "error", brace = "(" },
{ name = "format", brace = "(" },
{ name = "format_args", brace = "(" },
{ name = "info", brace = "(" },
{ name = "matches", brace = "(" },
{ name = "panic", brace = "(" },
{ name = "print", brace = "(" },
{ name = "println", brace = "(" },
{ name = "trace", brace = "(" },
{ name = "vec", brace = "[" },
{ name = "warn", brace = "(" },
{ name = "write", brace = "(" },
{ name = "writeln", brace = "(" },
]
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ trackable02 = { version = "0.2.24", package = "trackable", default-features = fa
trackable1 = { version = "1.3", package = "trackable", default-features = false }

[dev-dependencies]
tokio-test = "0.4"
hex = "0.4"
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
`medea-turn`
============

[![CI](https://github.com/instrumentisto/medea-turn-rs/workflows/CI/badge.svg?branch=main "CI")](https://github.com/instrumentisto/medea-turn-rs/actions?query=workflow%3ACI+branch%3Amain)
[![crates.io](https://img.shields.io/crates/v/medea-turn.svg "crates.io")](https://crates.io/crates/medea-turn)
[![Rust 1.74+](https://img.shields.io/badge/rustc-1.74+-lightgray.svg "Rust 1.74+")](https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html)
[![Unsafe Forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg "Unsafe forbidden")](https://github.com/rust-secure-code/safety-dance)
[![CI](https://github.com/instrumentisto/medea-turn-rs/workflows/CI/badge.svg?branch=main "CI")](https://github.com/instrumentisto/medea-turn-rs/actions?query=workflow%3ACI+branch%3Amain)
[![Rust docs](https://docs.rs/medea-turn/badge.svg "Rust docs")](https://docs.rs/medea-turn)

[Changelog](https://github.com/instrumentisto/medea-turn-rs/blob/master/CHANGELOG.md)

Expand Down
13 changes: 6 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
rust_2018_idioms,
rustdoc::all,
trivial_casts,
trivial_numeric_casts,
unsafe_code
trivial_numeric_casts
)]
#![forbid(non_ascii_idents)]
#![forbid(non_ascii_idents, unsafe_code)]
#![warn(
clippy::absolute_paths,
clippy::as_conversions,
Expand Down Expand Up @@ -52,7 +51,6 @@
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
clippy::missing_assert_message,
Expand All @@ -79,7 +77,6 @@
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
clippy::readonly_write_lock,
clippy::redundant_clone,
clippy::redundant_type_annotations,
clippy::ref_patterns,
Expand Down Expand Up @@ -128,9 +125,11 @@
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
redundant_lifetimes,
semicolon_in_expressions_from_macros,
single_use_lifetimes,
unit_bindings,
unnameable_types,
unreachable_pub,
unsafe_op_in_unsafe_fn,
unstable_features,
Expand All @@ -143,11 +142,10 @@
unused_results,
variant_size_differences
)]
#![cfg_attr(test, allow(unused_crate_dependencies, unused_lifetimes))]

mod allocation;
mod attr;
mod chandata;
pub mod chandata;
pub mod relay;
mod server;
pub mod transport;
Expand All @@ -161,6 +159,7 @@ pub(crate) use self::allocation::Allocation;
pub(crate) use self::transport::Transport;
pub use self::{
allocation::{FiveTuple, Info as AllocationInfo},
chandata::ChannelData,
server::{Config as ServerConfig, Server},
};

Expand Down

0 comments on commit 5ecc5d0

Please sign in to comment.