mirror of
https://github.com/mii443/merkle.rs.git
synced 2025-08-22 16:05:30 +00:00
Ignore protobuf schema when rustfmt
is invoked
This commit is contained in:
committed by
Romain Ruetschi
parent
f737c89da5
commit
7a1add13a1
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
Cargo.lock
|
||||
target/
|
||||
src/proto/proof.rs
|
||||
|
@ -18,6 +18,7 @@ categories = ["data-structures", "cryptography"]
|
||||
|
||||
|
||||
[dependencies]
|
||||
cfg-if = "0.1.3"
|
||||
ring = "^0.12.0"
|
||||
protobuf = { version = "1.7.1", optional = true }
|
||||
serde = { version = "^1.0.55", optional = true }
|
||||
|
35
src/lib.rs
35
src/lib.rs
@ -1,21 +1,28 @@
|
||||
#![deny(
|
||||
missing_docs, unused_qualifications, missing_debug_implementations,
|
||||
missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code,
|
||||
unstable_features, unused_import_braces
|
||||
)]
|
||||
#![deny(missing_docs, unused_qualifications, missing_debug_implementations,
|
||||
missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code,
|
||||
unstable_features, unused_import_braces)]
|
||||
|
||||
//! *merkle* implements a Merkle Tree in Rust.
|
||||
|
||||
#[macro_use]
|
||||
extern crate cfg_if;
|
||||
extern crate ring;
|
||||
|
||||
#[cfg(feature = "serialization-protobuf")]
|
||||
extern crate protobuf;
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "serialization-protobuf")] {
|
||||
extern crate protobuf;
|
||||
#[allow(unused_qualifications)]
|
||||
mod proto;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "serialization-serde")]
|
||||
extern crate serde;
|
||||
#[cfg(feature = "serialization-serde")]
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "serialization-serde")] {
|
||||
extern crate serde;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
}
|
||||
}
|
||||
|
||||
mod merkletree;
|
||||
pub use merkletree::MerkleTree;
|
||||
@ -29,9 +36,5 @@ pub use hashutils::Hashable;
|
||||
mod tree;
|
||||
pub use tree::{LeavesIntoIterator, LeavesIterator};
|
||||
|
||||
#[cfg(feature = "serialization-protobuf")]
|
||||
#[allow(unused_qualifications)]
|
||||
mod proto;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
@ -52,10 +52,8 @@ mod algorithm_serde {
|
||||
|
||||
mod test {
|
||||
use super::*;
|
||||
use ring::digest::{
|
||||
SHA1 as sha1, SHA256 as sha256, SHA384 as sha384, SHA512 as sha512,
|
||||
SHA512_256 as sha512_256,
|
||||
};
|
||||
use ring::digest::{SHA1 as sha1, SHA256 as sha256, SHA384 as sha384, SHA512 as sha512,
|
||||
SHA512_256 as sha512_256};
|
||||
|
||||
static SHA1: &Algorithm = &sha1;
|
||||
static SHA256: &Algorithm = &sha256;
|
||||
|
@ -1,4 +1,8 @@
|
||||
mod proof;
|
||||
cfg_if! {
|
||||
if #[cfg(not(rustfmt))] {
|
||||
mod proof;
|
||||
}
|
||||
}
|
||||
|
||||
use ring::digest::Algorithm;
|
||||
|
||||
|
Reference in New Issue
Block a user