Skip to content

Commit

Permalink
Improve Rust API guidelines compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienG2 committed Apr 12, 2019
1 parent 020ce67 commit 59ef596
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
//! raw_output.push_str("world!");
//! ```

#![deny(missing_docs)]
#![deny(missing_debug_implementations, missing_docs)]

use crossbeam_utils::CachePadded;

Expand Down Expand Up @@ -149,6 +149,7 @@ impl<T: Send> TripleBuffer<T> {
//
// The Clone and PartialEq traits are used internally for testing.
//
#[doc(hidden)]
impl<T: Clone + Send> Clone for TripleBuffer<T> {
fn clone(&self) -> Self {
// Clone the shared state. This is safe because at this layer of the
Expand All @@ -169,6 +170,7 @@ impl<T: Clone + Send> Clone for TripleBuffer<T> {
}
}
//
#[doc(hidden)]
impl<T: PartialEq + Send> PartialEq for TripleBuffer<T> {
fn eq(&self, other: &Self) -> bool {
// Compare the shared states. This is safe because at this layer of the
Expand Down Expand Up @@ -451,6 +453,7 @@ struct SharedState<T: Send> {
back_info: AtomicBackBufferInfo,
}
//
#[doc(hidden)]
impl<T: Clone + Send> SharedState<T> {
/// Cloning the shared state is unsafe because you must ensure that no one
/// is concurrently accessing it, since &self is enough for writing.
Expand All @@ -470,6 +473,7 @@ impl<T: Clone + Send> SharedState<T> {
}
}
//
#[doc(hidden)]
impl<T: PartialEq + Send> SharedState<T> {
/// Equality is unsafe for the same reason as cloning: you must ensure that
/// no one is concurrently accessing the triple buffer to avoid data races.
Expand Down

0 comments on commit 59ef596

Please sign in to comment.