Skip to content

Commit

Permalink
Documentation for default types modified
Browse files Browse the repository at this point in the history
  • Loading branch information
athulappadan committed Sep 11, 2016
1 parent 49e77db commit 41881e8
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/liballoc/arc.rs
Expand Up @@ -718,7 +718,7 @@ impl<T: ?Sized> Clone for Weak<T> {

#[stable(feature = "downgraded_weak", since = "1.10.0")]
impl<T> Default for Weak<T> {
/// Creates a new `Weak<T>`.
/// Constructs a new `Weak<T>` without an accompanying instance of T.
fn default() -> Weak<T> {
Weak::new()
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/borrow.rs
Expand Up @@ -249,7 +249,7 @@ impl<'a, B: ?Sized> Default for Cow<'a, B>
where B: ToOwned,
<B as ToOwned>::Owned: Default
{
/// Creates a `Cow<'a, B>` pointer.
/// Creates an owned Cow<'a, B> with the default value for the contained owned value.
fn default() -> Cow<'a, B> {
Owned(<B as ToOwned>::Owned::default())
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/btree/set.rs
Expand Up @@ -674,7 +674,7 @@ impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BTreeSet<T> {

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord> Default for BTreeSet<T> {
/// Creates a new `BTreeSet<T>`.
/// Makes a empty `BTreeSet<T>` with a reasonable choice of B.
fn default() -> BTreeSet<T> {
BTreeSet::new()
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/vec_deque.rs
Expand Up @@ -84,7 +84,7 @@ impl<T> Drop for VecDeque<T> {

#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Default for VecDeque<T> {
/// Creates a `VecDeque<T>` with a constant initial capacity.
/// Creates an empty `VecDeque<T>`.
#[inline]
fn default() -> VecDeque<T> {
VecDeque::new()
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/option.rs
Expand Up @@ -698,7 +698,7 @@ fn expect_failed(msg: &str) -> ! {

#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Default for Option<T> {
/// Creates an instance of None.
/// Returns None.
#[inline]
fn default() -> Option<T> { None }
}
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/slice.rs
Expand Up @@ -755,13 +755,13 @@ impl<T> ops::IndexMut<ops::RangeToInclusive<usize>> for [T] {

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> Default for &'a [T] {
/// Creates an empty Slice.
/// Creates an empty slice.
fn default() -> &'a [T] { &[] }
}

#[stable(feature = "mut_slice_default", since = "1.5.0")]
impl<'a, T> Default for &'a mut [T] {
/// Creates a mutable empty Slice.
/// Creates a mutable empty slice.
fn default() -> &'a mut [T] { &mut [] }
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/sync/atomic.rs
Expand Up @@ -118,7 +118,7 @@ pub struct AtomicPtr<T> {
#[cfg(target_has_atomic = "ptr")]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Default for AtomicPtr<T> {
/// Creates an `AtomicPtr<T>` with an initial mutable null pointer.
/// Creates a null `AtomicPtr<T>`.
fn default() -> AtomicPtr<T> {
AtomicPtr::new(::ptr::null_mut())
}
Expand Down
2 changes: 0 additions & 2 deletions src/libcoretest/hash/mod.rs
Expand Up @@ -18,7 +18,6 @@ struct MyHasher {
}

impl Default for MyHasher {
/// Constructs a `MyHasher` with initial value zero.
fn default() -> MyHasher {
MyHasher { hash: 0 }
}
Expand Down Expand Up @@ -91,7 +90,6 @@ impl Hasher for CustomHasher {
}

impl Default for CustomHasher {
/// Constructs a `CustomHasher` with initial value zero.
fn default() -> CustomHasher {
CustomHasher { output: 0 }
}
Expand Down
1 change: 0 additions & 1 deletion src/librustc/session/config.rs
Expand Up @@ -84,7 +84,6 @@ pub enum ErrorOutputType {
}

impl Default for ErrorOutputType {
/// Creates an `HumanReadble`, initialised with `ColorConfig` enum type `Auto`.
fn default() -> ErrorOutputType {
ErrorOutputType::HumanReadable(ColorConfig::Auto)
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/collections/hash/map.rs
Expand Up @@ -1218,7 +1218,7 @@ impl<K, V, S> Default for HashMap<K, V, S>
where K: Eq + Hash,
S: BuildHasher + Default,
{
/// Creates a `HashMap<K, V, S>`, with initial `Default` hasher.
/// Creates an empty `HashMap<K, V, S>`, with the `Default` value for the hasher.
fn default() -> HashMap<K, V, S> {
HashMap::with_hasher(Default::default())
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/collections/hash/set.rs
Expand Up @@ -665,7 +665,7 @@ impl<T, S> Default for HashSet<T, S>
where T: Eq + Hash,
S: BuildHasher + Default,
{
/// Creates a `HashSet<T, S>` with initial `Default` hasher.
/// Creates an empty `HashSet<T, S>` with the `Default` value for the hasher.
fn default() -> HashSet<T, S> {
HashSet::with_hasher(Default::default())
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/ffi/c_str.rs
Expand Up @@ -339,7 +339,7 @@ impl<'a> Default for &'a CStr {

#[stable(feature = "cstr_default", since = "1.10.0")]
impl Default for CString {
/// Creates a new `CString`, by calling the `Default` of `CStr`, and then owns it.
/// Creates an empty `CString`.
fn default() -> CString {
let a: &CStr = Default::default();
a.to_owned()
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ptr.rs
Expand Up @@ -154,7 +154,7 @@ impl<T> P<[T]> {
}

impl<T> Default for P<[T]> {
/// Creates a new `P`, with the `Default` value for T.
/// Creates an empty `P<[T]>`.
fn default() -> P<[T]> {
P::new()
}
Expand Down

0 comments on commit 41881e8

Please sign in to comment.