Skip to content

Commit 72cbb92

Browse files
authored
docs: fix broken links (#639)
Fixed a few broken links and converted a lot of them from the html-link to intra-doc links.
1 parent bde8c50 commit 72cbb92

File tree

9 files changed

+9
-25
lines changed

9 files changed

+9
-25
lines changed

src/buf/chain.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ use std::io::IoSlice;
2525
/// assert_eq!(full[..], b"hello world"[..]);
2626
/// ```
2727
///
28-
/// [`Buf::chain`]: trait.Buf.html#method.chain
29-
/// [`Buf`]: trait.Buf.html
30-
/// [`BufMut`]: trait.BufMut.html
28+
/// [`Buf::chain`]: Buf::chain
3129
#[derive(Debug)]
3230
pub struct Chain<T, U> {
3331
a: T,

src/buf/iter.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ use crate::Buf;
1717
/// assert_eq!(iter.next(), Some(b'c'));
1818
/// assert_eq!(iter.next(), None);
1919
/// ```
20-
///
21-
/// [`iter`]: trait.Buf.html#method.iter
22-
/// [`Buf`]: trait.Buf.html
2320
#[derive(Debug)]
2421
pub struct IntoIter<T> {
2522
inner: T,

src/buf/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
//! See [`Buf`] and [`BufMut`] for more details.
1414
//!
1515
//! [rope]: https://en.wikipedia.org/wiki/Rope_(data_structure)
16-
//! [`Buf`]: trait.Buf.html
17-
//! [`BufMut`]: trait.BufMut.html
1816
1917
mod buf_impl;
2018
mod buf_mut;

src/buf/reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{cmp, io};
55
/// A `Buf` adapter which implements `io::Read` for the inner value.
66
///
77
/// This struct is generally created by calling `reader()` on `Buf`. See
8-
/// documentation of [`reader()`](trait.Buf.html#method.reader) for more
8+
/// documentation of [`reader()`](Buf::reader) for more
99
/// details.
1010
#[derive(Debug)]
1111
pub struct Reader<B> {

src/buf/take.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::cmp;
55
/// A `Buf` adapter which limits the bytes read from an underlying buffer.
66
///
77
/// This struct is generally created by calling `take()` on `Buf`. See
8-
/// documentation of [`take()`](trait.Buf.html#method.take) for more details.
8+
/// documentation of [`take()`](Buf::take) for more details.
99
#[derive(Debug)]
1010
pub struct Take<T> {
1111
inner: T,

src/buf/writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{cmp, io};
55
/// A `BufMut` adapter which implements `io::Write` for the inner value.
66
///
77
/// This struct is generally created by calling `writer()` on `BufMut`. See
8-
/// documentation of [`writer()`](trait.BufMut.html#method.writer) for more
8+
/// documentation of [`writer()`](BufMut::writer) for more
99
/// details.
1010
#[derive(Debug)]
1111
pub struct Writer<B> {

src/bytes.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ impl Bytes {
438438
/// If `len` is greater than the buffer's current length, this has no
439439
/// effect.
440440
///
441-
/// The [`split_off`] method can emulate `truncate`, but this causes the
441+
/// The [split_off](`Self::split_off()`) method can emulate `truncate`, but this causes the
442442
/// excess bytes to be returned instead of dropped.
443443
///
444444
/// # Examples
@@ -450,8 +450,6 @@ impl Bytes {
450450
/// buf.truncate(5);
451451
/// assert_eq!(buf, b"hello"[..]);
452452
/// ```
453-
///
454-
/// [`split_off`]: #method.split_off
455453
#[inline]
456454
pub fn truncate(&mut self, len: usize) {
457455
if len < self.len {

src/bytes_mut.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl BytesMut {
399399
///
400400
/// Existing underlying capacity is preserved.
401401
///
402-
/// The [`split_off`] method can emulate `truncate`, but this causes the
402+
/// The [split_off](`Self::split_off()`) method can emulate `truncate`, but this causes the
403403
/// excess bytes to be returned instead of dropped.
404404
///
405405
/// # Examples
@@ -411,8 +411,6 @@ impl BytesMut {
411411
/// buf.truncate(5);
412412
/// assert_eq!(buf, b"hello"[..]);
413413
/// ```
414-
///
415-
/// [`split_off`]: #method.split_off
416414
pub fn truncate(&mut self, len: usize) {
417415
if len <= self.len() {
418416
unsafe {

src/lib.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
//! Provides abstractions for working with bytes.
1010
//!
1111
//! The `bytes` crate provides an efficient byte buffer structure
12-
//! ([`Bytes`](struct.Bytes.html)) and traits for working with buffer
12+
//! ([`Bytes`]) and traits for working with buffer
1313
//! implementations ([`Buf`], [`BufMut`]).
1414
//!
15-
//! [`Buf`]: trait.Buf.html
16-
//! [`BufMut`]: trait.BufMut.html
17-
//!
1815
//! # `Bytes`
1916
//!
2017
//! `Bytes` is an efficient container for storing and operating on contiguous
@@ -52,9 +49,7 @@
5249
//! `a` and `b` will share the underlying buffer and maintain indices tracking
5350
//! the view into the buffer represented by the handle.
5451
//!
55-
//! See the [struct docs] for more details.
56-
//!
57-
//! [struct docs]: struct.Bytes.html
52+
//! See the [struct docs](`Bytes`) for more details.
5853
//!
5954
//! # `Buf`, `BufMut`
6055
//!
@@ -70,7 +65,7 @@
7065
//! ## Relation with `Read` and `Write`
7166
//!
7267
//! At first glance, it may seem that `Buf` and `BufMut` overlap in
73-
//! functionality with `std::io::Read` and `std::io::Write`. However, they
68+
//! functionality with [`std::io::Read`] and [`std::io::Write`]. However, they
7469
//! serve different purposes. A buffer is the value that is provided as an
7570
//! argument to `Read::read` and `Write::write`. `Read` and `Write` may then
7671
//! perform a syscall, which has the potential of failing. Operations on `Buf`

0 commit comments

Comments
 (0)