Skip to content

Commit 6fa16d6

Browse files
committed
pluralize doc comment verbs and add missing periods
1 parent 588d37c commit 6fa16d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+380
-380
lines changed

src/libcollections/bit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ impl BitVec {
923923
self.set(insert_pos, elem);
924924
}
925925

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

1698-
/// Return the number of set bits in this set.
1698+
/// Returns the number of set bits in this set.
16991699
#[inline]
17001700
#[stable(feature = "rust1", since = "1.0.0")]
17011701
pub fn len(&self) -> usize {

src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ impl<K, V> BTreeMap<K, V> {
13391339
Values { inner: self.iter().map(second) }
13401340
}
13411341

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

1357-
/// Return true if the map contains no elements.
1357+
/// Returns true if the map contains no elements.
13581358
///
13591359
/// # Examples
13601360
///

src/libcollections/btree/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl<T: Ord> BTreeSet<T> {
284284
Union{a: self.iter().peekable(), b: other.iter().peekable()}
285285
}
286286

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

302-
/// Returns true if the set contains no elements
302+
/// Returns true if the set contains no elements.
303303
///
304304
/// # Examples
305305
///

src/libcollections/slice.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ impl<T> [T] {
549549
core_slice::SliceExt::binary_search_by(self, f)
550550
}
551551

552-
/// Return the number of elements in the slice
552+
/// Returns the number of elements in the slice.
553553
///
554554
/// # Example
555555
///
@@ -757,7 +757,7 @@ impl<T> [T] {
757757
core_slice::SliceExt::get_unchecked_mut(self, index)
758758
}
759759

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

987-
/// Convert `self` into a vector without clones or allocation.
987+
/// Converts `self` into a vector without clones or allocation.
988988
#[stable(feature = "rust1", since = "1.0.0")]
989989
#[inline]
990990
pub fn into_vec(self: Box<Self>) -> Vec<T> {

src/libcollections/str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ impl str {
12481248
core_str::StrExt::trim_right_matches(&self[..], pat)
12491249
}
12501250

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

1438-
/// Convert `self` to a byte slice.
1438+
/// Converts `self` to a byte slice.
14391439
///
14401440
/// # Examples
14411441
///
@@ -1591,7 +1591,7 @@ impl str {
15911591
core_str::StrExt::subslice_offset(&self[..], inner)
15921592
}
15931593

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

1612-
/// Return an iterator of `u16` over the string encoded as UTF-16.
1612+
/// Returns an iterator of `u16` over the string encoded as UTF-16.
16131613
#[unstable(feature = "collections",
16141614
reason = "this functionality may only be provided by libunicode")]
16151615
pub fn utf16_units(&self) -> Utf16Units {

src/libcollections/string.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl String {
347347
String { vec: bytes }
348348
}
349349

350-
/// Return the underlying byte buffer, encoded as UTF-8.
350+
/// Returns the underlying byte buffer, encoded as UTF-8.
351351
///
352352
/// # Examples
353353
///
@@ -363,7 +363,7 @@ impl String {
363363
self.vec
364364
}
365365

366-
/// Extract a string slice containing the entire string.
366+
/// Extracts a string slice containing the entire string.
367367
#[inline]
368368
#[unstable(feature = "convert",
369369
reason = "waiting on RFC revision")]
@@ -607,7 +607,7 @@ impl String {
607607
ch
608608
}
609609

610-
/// Insert a character into the string buffer at byte position `idx`.
610+
/// Inserts a character into the string buffer at byte position `idx`.
611611
///
612612
/// # Warning
613613
///
@@ -662,7 +662,7 @@ impl String {
662662
&mut self.vec
663663
}
664664

665-
/// Return the number of bytes in this string.
665+
/// Returns the number of bytes in this string.
666666
///
667667
/// # Examples
668668
///
@@ -705,12 +705,12 @@ impl String {
705705
}
706706

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

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

962-
/// Convert a string slice to a wrapper type providing a `&String` reference.
962+
/// Converts a string slice to a wrapper type providing a `&String` reference.
963963
///
964964
/// # Examples
965965
///

src/libcollections/vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl<T> Vec<T> {
393393
}
394394
}
395395

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

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

1939-
/// Convert a slice to a wrapper type providing a `&Vec<T>` reference.
1939+
/// Converts a slice to a wrapper type providing a `&Vec<T>` reference.
19401940
#[unstable(feature = "collections")]
19411941
pub fn as_vec<'a, T>(x: &'a [T]) -> DerefVec<'a, T> {
19421942
unsafe {

src/libcollections/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ impl<T> VecDeque<T> {
481481
}
482482
}
483483

484-
/// Shorten a ringbuf, dropping excess elements from the back.
484+
/// Shortens a ringbuf, dropping excess elements from the back.
485485
///
486486
/// If `len` is greater than the ringbuf's current length, this has no
487487
/// effect.

src/libcollections/vec_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ impl<V> VecMap<V> {
452452
Drain { iter: self.v.drain().enumerate().filter_map(filter) }
453453
}
454454

455-
/// Return the number of elements in the map.
455+
/// Returns the number of elements in the map.
456456
///
457457
/// # Examples
458458
///
@@ -470,7 +470,7 @@ impl<V> VecMap<V> {
470470
self.v.iter().filter(|elt| elt.is_some()).count()
471471
}
472472

473-
/// Return true if the map contains no elements.
473+
/// Returns true if the map contains no elements.
474474
///
475475
/// # Examples
476476
///

src/libcore/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ use marker::{Reflect, Sized};
9191
/// [mod]: index.html
9292
#[stable(feature = "rust1", since = "1.0.0")]
9393
pub trait Any: Reflect + 'static {
94-
/// Get the `TypeId` of `self`
94+
/// Gets the `TypeId` of `self`.
9595
#[unstable(feature = "core",
9696
reason = "this method will likely be replaced by an associated static")]
9797
fn get_type_id(&self) -> TypeId;

src/libcore/cell.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl<T:Copy> Cell<T> {
211211
}
212212
}
213213

214-
/// Get a reference to the underlying `UnsafeCell`.
214+
/// Gets a reference to the underlying `UnsafeCell`.
215215
///
216216
/// # Unsafety
217217
///
@@ -436,7 +436,7 @@ impl<T> RefCell<T> {
436436
}
437437
}
438438

439-
/// Get a reference to the underlying `UnsafeCell`.
439+
/// Gets a reference to the underlying `UnsafeCell`.
440440
///
441441
/// This can be used to circumvent `RefCell`'s safety checks.
442442
///
@@ -537,7 +537,7 @@ impl<'b, T> Deref for Ref<'b, T> {
537537
}
538538
}
539539

540-
/// Copy a `Ref`.
540+
/// Copies a `Ref`.
541541
///
542542
/// The `RefCell` is already immutably borrowed, so this cannot fail.
543543
///
@@ -647,7 +647,7 @@ pub struct UnsafeCell<T> {
647647
impl<T> !Sync for UnsafeCell<T> {}
648648

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

688-
/// Unwraps the value
688+
/// Unwraps the value.
689689
///
690690
/// # Unsafety
691691
///

src/libcore/clone.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub trait Clone : Sized {
3838
#[stable(feature = "rust1", since = "1.0.0")]
3939
fn clone(&self) -> Self;
4040

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

5353
#[stable(feature = "rust1", since = "1.0.0")]
5454
impl<'a, T: ?Sized> Clone for &'a T {
55-
/// Return a shallow copy of the reference.
55+
/// Returns a shallow copy of the reference.
5656
#[inline]
5757
fn clone(&self) -> &'a T { *self }
5858
}
@@ -61,7 +61,7 @@ macro_rules! clone_impl {
6161
($t:ty) => {
6262
#[stable(feature = "rust1", since = "1.0.0")]
6363
impl Clone for $t {
64-
/// Return a deep copy of the value.
64+
/// Returns a deep copy of the value.
6565
#[inline]
6666
fn clone(&self) -> $t { *self }
6767
}
@@ -92,28 +92,28 @@ macro_rules! extern_fn_clone {
9292
#[unstable(feature = "core",
9393
reason = "this may not be sufficient for fns with region parameters")]
9494
impl<$($A,)* ReturnType> Clone for extern "Rust" fn($($A),*) -> ReturnType {
95-
/// Return a copy of a function pointer
95+
/// Returns a copy of a function pointer.
9696
#[inline]
9797
fn clone(&self) -> extern "Rust" fn($($A),*) -> ReturnType { *self }
9898
}
9999

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

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

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

0 commit comments

Comments
 (0)