Skip to content

Commit

Permalink
Check docs in QA, modernise lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalmer committed Apr 28, 2024
1 parent 2a66991 commit 347cc26
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 88 deletions.
86 changes: 0 additions & 86 deletions .cargo/config.toml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ jobs:
cargo +${{steps.rust-install.outputs.name}} clippy -- -D warnings
cargo +${{steps.rust-install.outputs.name}} clippy --all-features -- -D warnings
- name: Check docs
run: |
cargo +${{steps.rust-install.outputs.name}} rustdoc -- -D warnings
bench:
runs-on: ubuntu-latest
name: "Benchmarks"
Expand Down
88 changes: 88 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ categories = ["algorithms", "cryptography"]
exclude = ["/.git*", "Cargo.toml.orig"]
version = "0.0.0-git"
edition = "2021"
rust-version = "1.74.0"

[features]
serde = ["dep:serde", "dep:serde_bytes"]
Expand Down Expand Up @@ -36,3 +37,90 @@ debug = true
[[bench]]
name = "cretrit"
harness = false

[lints.rust]
dead_code = "warn"
elided_lifetimes_in_paths = "warn"
explicit_outlives_requirements = "warn"
future_incompatible = "warn"
keyword_idents = "warn"
let_underscore = "warn"
missing_debug_implementations = "warn"
missing_docs = "warn"
non_ascii_idents = "warn"
noop_method_call = "warn"
single_use_lifetimes = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unreachable_pub = "warn"
unsafe_code = "warn"
unsafe_op_in_unsafe_fn = "warn"
unused = "warn"
unused_crate_dependencies = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_macro_rules = "warn"
unused_qualifications = "warn"

[lints.clippy]
all = "warn"
alloc_instead_of_core = "warn"
arithmetic_side_effects = "warn"
as_underscore = "warn"
assertions_on_result_states = "warn"
cargo = "warn"
clone_on_ref_ptr = "warn"
dbg_macro = "warn"
decimal_literal_representation = "warn"
default_numeric_fallback = "warn"
deref_by_slicing = "warn"
else_if_without_else = "warn"
exhaustive_enums = "warn"
exhaustive_structs = "warn"
exit = "warn"
expect_used = "warn"
float_arithmetic = "warn"
float_cmp_const = "warn"
fn_to_numeric_cast_any = "warn"
format_push_string = "warn"
get_unwrap = "warn"
if_then_some_else_none = "warn"
indexing_slicing = "warn"
integer_division = "warn"
let_underscore_must_use = "warn"
lossy_float_literal = "warn"
map_err_ignore = "warn"
missing_docs_in_private_items = "warn"
mixed_read_write_in_expression = "warn"
multiple_inherent_impl = "warn"
non_ascii_literal = "warn"
panic = "warn"
panic_in_result_fn = "warn"
partial_pub_fields = "warn"
pedantic = "warn"
print_stderr = "warn"
print_stdout = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_name_method = "warn"
self_named_module_files = "warn"
semicolon_inside_block = "warn"
separated_literal_suffix = "warn"
shadow_reuse = "warn"
shadow_same = "warn"
shadow_unrelated = "warn"
string_slice = "warn"
string_to_string = "warn"
suspicious_xor_used_as_pow = "warn"
todo = "warn"
try_err = "warn"
undocumented_unsafe_blocks = "warn"
unimplemented = "warn"
unnecessary_safety_comment = "warn"
unnecessary_safety_doc = "warn"
unneeded_field_pattern = "warn"
unreachable = "warn"
unwrap_used = "warn"
use_debug = "warn"
wildcard_enum_match_arm = "warn"
4 changes: 2 additions & 2 deletions src/prf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ pub trait PseudoRandomFunctionInit: Sized + PseudoRandomFunction {

/// Operation of a PRF
pub trait PseudoRandomFunction: Sized {
/// The exact type of the block of data that will be returned by randomise()
/// The exact type of the block of data that will be returned by `randomise()`
///
/// In practice this will always be a u8 array of some size
type BlockType: Default + Copy + Fill + core::fmt::Debug + Into<Vec<u8>> + AsMut<[u8]>;

/// The number of elements in the block returned from randomise()
/// The number of elements in the block returned from `randomise()`
///
/// Unsurprisingly, this must match the number of elements in `BlockType`
const BLOCK_SIZE: usize;
Expand Down

0 comments on commit 347cc26

Please sign in to comment.