Skip to content

Commit 8d90a0d

Browse files
waywardmonkeysmbrubeck
authored andcommitted
Minor tweaks to doc formatting.
1 parent 8350525 commit 8d90a0d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ fn infallible<T>(result: Result<T, CollectionAllocErr>) -> T {
328328
}
329329

330330
/// FIXME: use `Layout::array` when we require a Rust version where it’s stable
331-
/// https://github.com/rust-lang/rust/issues/55724
331+
/// <https://github.com/rust-lang/rust/issues/55724>
332332
fn layout_array<T>(n: usize) -> Result<Layout, CollectionAllocErr> {
333333
let size = mem::size_of::<T>()
334334
.checked_mul(n)
@@ -815,7 +815,7 @@ impl<A: Array> SmallVec<A> {
815815

816816
/// Construct a new `SmallVec` from a `Vec<A::Item>`.
817817
///
818-
/// Elements will be copied to the inline buffer if vec.capacity() <= Self::inline_capacity().
818+
/// Elements will be copied to the inline buffer if `vec.capacity() <= Self::inline_capacity()`.
819819
///
820820
/// ```rust
821821
/// use smallvec::SmallVec;
@@ -970,7 +970,7 @@ impl<A: Array> SmallVec<A> {
970970
}
971971

972972
/// Returns a tuple with (data ptr, len, capacity)
973-
/// Useful to get all SmallVec properties with a single check of the current storage variant.
973+
/// Useful to get all `SmallVec` properties with a single check of the current storage variant.
974974
#[inline]
975975
fn triple(&self) -> (ConstNonNull<A::Item>, usize, usize) {
976976
unsafe {
@@ -1475,7 +1475,7 @@ impl<A: Array> SmallVec<A> {
14751475
}
14761476
}
14771477

1478-
/// Convert a SmallVec to a Vec, without reallocating if the SmallVec has already spilled onto
1478+
/// Convert a `SmallVec` to a `Vec`, without reallocating if the `SmallVec` has already spilled onto
14791479
/// the heap.
14801480
pub fn into_vec(mut self) -> Vec<A::Item> {
14811481
if self.spilled() {
@@ -1498,10 +1498,10 @@ impl<A: Array> SmallVec<A> {
14981498
self.into_vec().into_boxed_slice()
14991499
}
15001500

1501-
/// Convert the SmallVec into an `A` if possible. Otherwise return `Err(Self)`.
1501+
/// Convert the `SmallVec` into an `A` if possible. Otherwise return `Err(Self)`.
15021502
///
1503-
/// This method returns `Err(Self)` if the SmallVec is too short (and the `A` contains uninitialized elements),
1504-
/// or if the SmallVec is too long (and all the elements were spilled to the heap).
1503+
/// This method returns `Err(Self)` if the `SmallVec` is too short (and the `A` contains uninitialized elements),
1504+
/// or if the `SmallVec` is too long (and all the elements were spilled to the heap).
15051505
pub fn into_inner(self) -> Result<A, Self> {
15061506
if self.spilled() || self.len() != A::size() {
15071507
// Note: A::size, not Self::inline_capacity
@@ -1595,15 +1595,15 @@ impl<A: Array> SmallVec<A> {
15951595
///
15961596
/// If `new_len` is greater than `len`, the `SmallVec` is extended by the difference, with each
15971597
/// additional slot filled with the result of calling the closure `f`. The return values from `f`
1598-
//// will end up in the `SmallVec` in the order they have been generated.
1598+
/// will end up in the `SmallVec` in the order they have been generated.
15991599
///
16001600
/// If `new_len` is less than `len`, the `SmallVec` is simply truncated.
16011601
///
16021602
/// This method uses a closure to create new values on every push. If you'd rather `Clone` a given
16031603
/// value, use `resize`. If you want to use the `Default` trait to generate values, you can pass
16041604
/// `Default::default()` as the second argument.
16051605
///
1606-
/// Added for std::vec::Vec compatibility (added in Rust 1.33.0)
1606+
/// Added for `std::vec::Vec` compatibility (added in Rust 1.33.0)
16071607
///
16081608
/// ```
16091609
/// # use smallvec::{smallvec, SmallVec};
@@ -2321,7 +2321,7 @@ impl<'a, A: Array> IntoIterator for &'a mut SmallVec<A> {
23212321
}
23222322
}
23232323

2324-
/// Types that can be used as the backing store for a SmallVec
2324+
/// Types that can be used as the backing store for a [`SmallVec`].
23252325
pub unsafe trait Array {
23262326
/// The type of the array's elements.
23272327
type Item;
@@ -2331,7 +2331,7 @@ pub unsafe trait Array {
23312331

23322332
/// Set the length of the vec when the `SetLenOnDrop` value goes out of scope.
23332333
///
2334-
/// Copied from https://github.com/rust-lang/rust/pull/36355
2334+
/// Copied from <https://github.com/rust-lang/rust/pull/36355>
23352335
struct SetLenOnDrop<'a> {
23362336
len: &'a mut usize,
23372337
local_len: usize,

src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ pub fn test_double_spill() {
7272
);
7373
}
7474

75-
/// https://github.com/servo/rust-smallvec/issues/4
75+
// https://github.com/servo/rust-smallvec/issues/4
7676
#[test]
7777
fn issue_4() {
7878
SmallVec::<[Box<u32>; 2]>::new();
7979
}
8080

81-
/// https://github.com/servo/rust-smallvec/issues/5
81+
// https://github.com/servo/rust-smallvec/issues/5
8282
#[test]
8383
fn issue_5() {
8484
assert!(Some(SmallVec::<[&u32; 2]>::new()).is_some());

0 commit comments

Comments
 (0)