Skip to content

Commit

Permalink
Add/fix links in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Jan 28, 2024
1 parent 99b2da0 commit 4e958b4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! directory.
//!
//! When a [`Pushd`] struct is created it will call [`env::set_current_dir`]
//! to change to the given directory. When the `Pushd` is dropped, it will
//! to change to the given directory. When the [`Pushd`] is dropped, it will
//! change back to the original directory.
//!
//! If the original directory doesn't exist, this error is ignored, since this
Expand All @@ -27,8 +27,8 @@
//!
//! # Panics
//!
//! The `Pushd` may panic if it cannot change back to the original directory
//! when it's dropped. Use the [`new_no_panic`](Pushd::new_no_panic)
//! The [`Pushd`] may panic if it cannot change back to the original directory
//! when it's dropped. Use the [`Pushd::new_no_panic`](Pushd::new_no_panic)
//! constructor to prevent this.
use log::{debug, warn};
use std::error::Error as StdError;
Expand Down Expand Up @@ -66,7 +66,7 @@ pub struct Pushd {
impl Pushd {
/// Constructs a new `Pushd` struct.
///
/// This accepts any type that implements `AsRef<Path>`.
/// This accepts any type that implements [`AsRef<Path>`].
///
/// The `Pushd` returned by this constructor will panic if it cannot
/// change back to its original directory when it is dropped.
Expand Down Expand Up @@ -100,7 +100,7 @@ impl Pushd {
/// [`log::debug!`](https://docs.rs/log/latest/log/macro.debug.html) to
/// log the directory change.
///
/// The `Pushd` created by this constructor cannot change back to the
/// If the [`Pushd`] created by this constructor cannot change back to the
/// original directory when it is dropped, then it will simply call
/// [`log::warn!`](https://docs.rs/log/latest/log/macro.warn.html) instead
/// of panicking.
Expand Down Expand Up @@ -134,12 +134,12 @@ impl Drop for Pushd {
/// When the `Pushd` struct is dropped, it will change back to the
/// original directory. If this fails, it's behavior is as follows:
///
/// * If the `Pushd` was constructed with `new_no_panic`, it will log the
/// error by calling
/// * If the [`Pushd`] was constructed with [`Pushd::new_no_panic`], it
/// will log the error by calling
/// [`log::warn!`](https://docs.rs/log/latest/log/macro.warn.html).
///
/// * If the `Pushd` was constructed with `new` and the error is an
/// [`io::Error`] and the error's [`io::Error::kind`] method returns
/// * If the [`Pushd`] was constructed with [`Pushd::new`] and the error
/// is an [`io::Error`] and the error's [`io::Error::kind`] method returns
/// [`io::ErrorKind::NotFound`], it will do nothing.
///
/// * Otherwise it will panic with the error from attempting to change the
Expand Down

0 comments on commit 4e958b4

Please sign in to comment.