Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for core::fmt and string_utils #175

Merged
merged 4 commits into from
Jun 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/core/data/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<V: Default> CEHashMap<V> {

/// Inserts a value into the map at the given key.
///
/// # Arguments
/// # Parameters
///
/// * `key` - the key at which to insert the value in the map.
/// * `value` - the value to be inserted into the map.
Expand Down Expand Up @@ -50,7 +50,7 @@ impl<V: Default> CEHashMap<V> {

/// Returns a reference to the value stored in the map at the given key, or `None` if no such value is stored.
///
/// # Arguments
/// # Parameters
///
/// * `key` - the key to look up in the map.
pub fn get(&self, key: usize) -> Option<&V> {
Expand All @@ -62,7 +62,7 @@ impl<V: Default> CEHashMap<V> {

/// Returns a _mutable_ reference to the value stored in the map at the given key, or `None` if no such value is stored.
///
/// # Arguments
/// # Parameters
///
/// * `key` - the key to look up in the map.
pub fn get_mut(&mut self, key: usize) -> Option<&mut V> {
Expand All @@ -74,7 +74,7 @@ impl<V: Default> CEHashMap<V> {

/// Returns `true` if there is a value stored in the map under the given key, and `false` otherwise.
///
/// # Arguments
/// # Parameters
///
/// * `key` - the key to look up in the map.
pub fn contains(&self, key: usize) -> bool {
Expand Down
2 changes: 2 additions & 0 deletions src/core/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ use std::{fmt, hash::Hash};

pub mod map;

/// A trait encapsulating some piece of data, with useful requirements for equality, comparison, and debugging.
pub trait Data: PartialEq + Eq + Hash + Clone + fmt::Debug + Send + Sync {
/// Returns a string representation of the data.
fn to_string(&self) -> String;
}

Expand Down
Loading