curve: fully migrate to 2018 module conventions (#844)

Enforced via the newly added `clippy::mod_module_files` lint.

Previously a mixture of 2015 (`mod.rs`) module files along with
the 2018 `foo.rs` and `foo/` approach.

All of the toplevel modules (`edwards`, `field`, `montgomery`, and
`scalar`) were using the 2018 convention, except for `backend`,
`ristretto`, and the recently added `lizard` were using the 2015
convention.

This renames the files so everything follows the 2018 convention, and
applies the afforementioned clippy lint which will error if anyone tries
to add new files using the 2015 convention.
This commit is contained in:
Tony Arcieri 2025-11-09 08:49:57 -07:00 committed by GitHub
parent b76b924080
commit 9e04a586c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 8 additions and 7 deletions

View file

@ -17,10 +17,10 @@
//! This uses the formally-verified field arithmetic generated by the //! This uses the formally-verified field arithmetic generated by the
//! [fiat-crypto project](https://github.com/mit-plv/fiat-crypto) //! [fiat-crypto project](https://github.com/mit-plv/fiat-crypto)
#[path = "../u32/scalar.rs"] #[path = "./u32/scalar.rs"]
pub mod scalar; pub mod scalar;
pub mod field; pub mod field;
#[path = "../u32/constants.rs"] #[path = "./u32/constants.rs"]
pub mod constants; pub mod constants;

View file

@ -19,10 +19,10 @@
//! (allowing the CPU to compute two carry chains in parallel). These //! (allowing the CPU to compute two carry chains in parallel). These
//! will be used if available. //! will be used if available.
#[path = "../u64/scalar.rs"] #[path = "./u64/scalar.rs"]
pub mod scalar; pub mod scalar;
pub mod field; pub mod field;
#[path = "../u64/constants.rs"] #[path = "./u64/constants.rs"]
pub mod constants; pub mod constants;

View file

@ -9,7 +9,7 @@
// - isis agora lovecruft <isis@patternsinthevoid.net> // - isis agora lovecruft <isis@patternsinthevoid.net>
// - Henry de Valence <hdevalence@hdevalence.ca> // - Henry de Valence <hdevalence@hdevalence.ca>
#![doc = include_str!("../../../docs/parallel-formulas.md")] #![doc = include_str!("../../docs/parallel-formulas.md")]
#[allow(missing_docs)] #[allow(missing_docs)]
pub mod packed_simd; pub mod packed_simd;

View file

@ -9,7 +9,7 @@
// - isis agora lovecruft <isis@patternsinthevoid.net> // - isis agora lovecruft <isis@patternsinthevoid.net>
// - Henry de Valence <hdevalence@hdevalence.ca> // - Henry de Valence <hdevalence@hdevalence.ca>
#![doc = include_str!("../../../../docs/avx2-notes.md")] #![doc = include_str!("../../../docs/avx2-notes.md")]
pub(crate) mod field; pub(crate) mod field;

View file

@ -7,7 +7,7 @@
// Authors: // Authors:
// - Henry de Valence <hdevalence@hdevalence.ca> // - Henry de Valence <hdevalence@hdevalence.ca>
#![doc = include_str!("../../../../docs/ifma-notes.md")] #![doc = include_str!("../../../docs/ifma-notes.md")]
#[allow(missing_docs)] #[allow(missing_docs)]
pub mod field; pub mod field;

View file

@ -24,6 +24,7 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
#![cfg_attr(allow_unused_unsafe, allow(unused_unsafe))] #![cfg_attr(allow_unused_unsafe, allow(unused_unsafe))]
#![warn( #![warn(
clippy::mod_module_files,
clippy::unwrap_used, clippy::unwrap_used,
missing_docs, missing_docs,
rust_2018_idioms, rust_2018_idioms,