Skip to content

pluralize doc comment verbs and add missing periods #24377

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

Merged
merged 1 commit into from
Apr 15, 2015
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
4 changes: 2 additions & 2 deletions src/libcollections/bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ impl BitVec {
self.set(insert_pos, elem);
}

/// Return the total number of bits in this vector
/// Returns the total number of bits in this vector
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn len(&self) -> usize { self.nbits }
Expand Down Expand Up @@ -1695,7 +1695,7 @@ impl BitSet {
self.other_op(other, |w1, w2| w1 ^ w2);
}

/// Return the number of set bits in this set.
/// Returns the number of set bits in this set.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn len(&self) -> usize {
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ impl<K, V> BTreeMap<K, V> {
Values { inner: self.iter().map(second) }
}

/// Return the number of elements in the map.
/// Returns the number of elements in the map.
///
/// # Examples
///
Expand All @@ -1354,7 +1354,7 @@ impl<K, V> BTreeMap<K, V> {
#[stable(feature = "rust1", since = "1.0.0")]
pub fn len(&self) -> usize { self.length }

/// Return true if the map contains no elements.
/// Returns true if the map contains no elements.
///
/// # Examples
///
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl<T: Ord> BTreeSet<T> {
Union{a: self.iter().peekable(), b: other.iter().peekable()}
}

/// Return the number of elements in the set
/// Returns the number of elements in the set.
///
/// # Examples
///
Expand All @@ -299,7 +299,7 @@ impl<T: Ord> BTreeSet<T> {
#[stable(feature = "rust1", since = "1.0.0")]
pub fn len(&self) -> usize { self.map.len() }

/// Returns true if the set contains no elements
/// Returns true if the set contains no elements.
///
/// # Examples
///
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ impl<T> [T] {
core_slice::SliceExt::binary_search_by(self, f)
}

/// Return the number of elements in the slice
/// Returns the number of elements in the slice.
///
/// # Example
///
Expand Down Expand Up @@ -757,7 +757,7 @@ impl<T> [T] {
core_slice::SliceExt::get_unchecked_mut(self, index)
}

/// Return an unsafe mutable pointer to the slice's buffer.
/// Returns an unsafe mutable pointer to the slice's buffer.
///
/// The caller must ensure that the slice outlives the pointer this
/// function returns, or else it will end up pointing to garbage.
Expand Down Expand Up @@ -984,7 +984,7 @@ impl<T> [T] {
core_slice::SliceExt::ends_with(self, needle)
}

/// Convert `self` into a vector without clones or allocation.
/// Converts `self` into a vector without clones or allocation.
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn into_vec(self: Box<Self>) -> Vec<T> {
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ impl str {
core_str::StrExt::trim_right_matches(&self[..], pat)
}

/// Check that `index`-th byte lies at the start and/or end of a
/// Checks that `index`-th byte lies at the start and/or end of a
/// UTF-8 code point sequence.
///
/// The start and end of the string (when `index == self.len()`) are
Expand Down Expand Up @@ -1435,7 +1435,7 @@ impl str {
core_str::StrExt::char_at_reverse(&self[..], i)
}

/// Convert `self` to a byte slice.
/// Converts `self` to a byte slice.
///
/// # Examples
///
Expand Down Expand Up @@ -1591,7 +1591,7 @@ impl str {
core_str::StrExt::subslice_offset(&self[..], inner)
}

/// Return an unsafe pointer to the `&str`'s buffer.
/// Returns an unsafe pointer to the `&str`'s buffer.
///
/// The caller must ensure that the string outlives this pointer, and
/// that it is not
Expand All @@ -1609,7 +1609,7 @@ impl str {
core_str::StrExt::as_ptr(&self[..])
}

/// Return an iterator of `u16` over the string encoded as UTF-16.
/// Returns an iterator of `u16` over the string encoded as UTF-16.
#[unstable(feature = "collections",
reason = "this functionality may only be provided by libunicode")]
pub fn utf16_units(&self) -> Utf16Units {
Expand Down
14 changes: 7 additions & 7 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl String {
String { vec: bytes }
}

/// Return the underlying byte buffer, encoded as UTF-8.
/// Returns the underlying byte buffer, encoded as UTF-8.
///
/// # Examples
///
Expand All @@ -363,7 +363,7 @@ impl String {
self.vec
}

/// Extract a string slice containing the entire string.
/// Extracts a string slice containing the entire string.
#[inline]
#[unstable(feature = "convert",
reason = "waiting on RFC revision")]
Expand Down Expand Up @@ -607,7 +607,7 @@ impl String {
ch
}

/// Insert a character into the string buffer at byte position `idx`.
/// Inserts a character into the string buffer at byte position `idx`.
///
/// # Warning
///
Expand Down Expand Up @@ -662,7 +662,7 @@ impl String {
&mut self.vec
}

/// Return the number of bytes in this string.
/// Returns the number of bytes in this string.
///
/// # Examples
///
Expand Down Expand Up @@ -705,12 +705,12 @@ impl String {
}

impl FromUtf8Error {
/// Consume this error, returning the bytes that were attempted to make a
/// Consumes this error, returning the bytes that were attempted to make a
/// `String` with.
#[stable(feature = "rust1", since = "1.0.0")]
pub fn into_bytes(self) -> Vec<u8> { self.bytes }

/// Access the underlying UTF8-error that was the cause of this error.
/// Accesss the underlying UTF8-error that was the cause of this error.
#[stable(feature = "rust1", since = "1.0.0")]
pub fn utf8_error(&self) -> Utf8Error { self.error }
}
Expand Down Expand Up @@ -959,7 +959,7 @@ impl<'a> Deref for DerefString<'a> {
}
}

/// Convert a string slice to a wrapper type providing a `&String` reference.
/// Converts a string slice to a wrapper type providing a `&String` reference.
///
/// # Examples
///
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ impl<T> Vec<T> {
}
}

/// Convert the vector into Box<[T]>.
/// Converts the vector into Box<[T]>.
///
/// Note that this will drop any excess capacity. Calling this and
/// converting back to a vector with `into_vec()` is equivalent to calling
Expand Down Expand Up @@ -434,7 +434,7 @@ impl<T> Vec<T> {
}
}

/// Extract a slice containing the entire vector.
/// Extracts a slice containing the entire vector.
#[inline]
#[unstable(feature = "convert",
reason = "waiting on RFC revision")]
Expand Down Expand Up @@ -1936,7 +1936,7 @@ impl<'a, T> Drop for DerefVec<'a, T> {
}
}

/// Convert a slice to a wrapper type providing a `&Vec<T>` reference.
/// Converts a slice to a wrapper type providing a `&Vec<T>` reference.
#[unstable(feature = "collections")]
pub fn as_vec<'a, T>(x: &'a [T]) -> DerefVec<'a, T> {
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ impl<T> VecDeque<T> {
}
}

/// Shorten a ringbuf, dropping excess elements from the back.
/// Shortens a ringbuf, dropping excess elements from the back.
///
/// If `len` is greater than the ringbuf's current length, this has no
/// effect.
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/vec_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl<V> VecMap<V> {
Drain { iter: self.v.drain().enumerate().filter_map(filter) }
}

/// Return the number of elements in the map.
/// Returns the number of elements in the map.
///
/// # Examples
///
Expand All @@ -470,7 +470,7 @@ impl<V> VecMap<V> {
self.v.iter().filter(|elt| elt.is_some()).count()
}

/// Return true if the map contains no elements.
/// Returns true if the map contains no elements.
///
/// # Examples
///
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ use marker::{Reflect, Sized};
/// [mod]: index.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Any: Reflect + 'static {
/// Get the `TypeId` of `self`
/// Gets the `TypeId` of `self`.
#[unstable(feature = "core",
reason = "this method will likely be replaced by an associated static")]
fn get_type_id(&self) -> TypeId;
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl<T:Copy> Cell<T> {
}
}

/// Get a reference to the underlying `UnsafeCell`.
/// Gets a reference to the underlying `UnsafeCell`.
///
/// # Unsafety
///
Expand Down Expand Up @@ -436,7 +436,7 @@ impl<T> RefCell<T> {
}
}

/// Get a reference to the underlying `UnsafeCell`.
/// Gets a reference to the underlying `UnsafeCell`.
///
/// This can be used to circumvent `RefCell`'s safety checks.
///
Expand Down Expand Up @@ -537,7 +537,7 @@ impl<'b, T> Deref for Ref<'b, T> {
}
}

/// Copy a `Ref`.
/// Copies a `Ref`.
///
/// The `RefCell` is already immutably borrowed, so this cannot fail.
///
Expand Down Expand Up @@ -647,7 +647,7 @@ pub struct UnsafeCell<T> {
impl<T> !Sync for UnsafeCell<T> {}

impl<T> UnsafeCell<T> {
/// Construct a new instance of `UnsafeCell` which will wrap the specified
/// Constructs a new instance of `UnsafeCell` which will wrap the specified
/// value.
///
/// All access to the inner value through methods is `unsafe`, and it is highly discouraged to
Expand Down Expand Up @@ -685,7 +685,7 @@ impl<T> UnsafeCell<T> {
&self.value as *const T as *mut T
}

/// Unwraps the value
/// Unwraps the value.
///
/// # Unsafety
///
Expand Down
14 changes: 7 additions & 7 deletions src/libcore/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub trait Clone : Sized {
#[stable(feature = "rust1", since = "1.0.0")]
fn clone(&self) -> Self;

/// Perform copy-assignment from `source`.
/// Performs copy-assignment from `source`.
///
/// `a.clone_from(&b)` is equivalent to `a = b.clone()` in functionality,
/// but can be overridden to reuse the resources of `a` to avoid unnecessary
Expand All @@ -52,7 +52,7 @@ pub trait Clone : Sized {

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Clone for &'a T {
/// Return a shallow copy of the reference.
/// Returns a shallow copy of the reference.
#[inline]
fn clone(&self) -> &'a T { *self }
}
Expand All @@ -61,7 +61,7 @@ macro_rules! clone_impl {
($t:ty) => {
#[stable(feature = "rust1", since = "1.0.0")]
impl Clone for $t {
/// Return a deep copy of the value.
/// Returns a deep copy of the value.
#[inline]
fn clone(&self) -> $t { *self }
}
Expand Down Expand Up @@ -92,28 +92,28 @@ macro_rules! extern_fn_clone {
#[unstable(feature = "core",
reason = "this may not be sufficient for fns with region parameters")]
impl<$($A,)* ReturnType> Clone for extern "Rust" fn($($A),*) -> ReturnType {
/// Return a copy of a function pointer
/// Returns a copy of a function pointer.
#[inline]
fn clone(&self) -> extern "Rust" fn($($A),*) -> ReturnType { *self }
}

#[unstable(feature = "core", reason = "brand new")]
impl<$($A,)* ReturnType> Clone for extern "C" fn($($A),*) -> ReturnType {
/// Return a copy of a function pointer
/// Returns a copy of a function pointer.
#[inline]
fn clone(&self) -> extern "C" fn($($A),*) -> ReturnType { *self }
}

#[unstable(feature = "core", reason = "brand new")]
impl<$($A,)* ReturnType> Clone for unsafe extern "Rust" fn($($A),*) -> ReturnType {
/// Return a copy of a function pointer
/// Returns a copy of a function pointer.
#[inline]
fn clone(&self) -> unsafe extern "Rust" fn($($A),*) -> ReturnType { *self }
}

#[unstable(feature = "core", reason = "brand new")]
impl<$($A,)* ReturnType> Clone for unsafe extern "C" fn($($A),*) -> ReturnType {
/// Return a copy of a function pointer
/// Returns a copy of a function pointer.
#[inline]
fn clone(&self) -> unsafe extern "C" fn($($A),*) -> ReturnType { *self }
}
Expand Down
Loading