Fix bad method links in docstrings (#13471)

# Description

Seems like I developed a bit of a bad habit of trying to link

```rust
/// [`.foo()`]
```

in docstrings, and this just doesn't work automatically; you have to do 

```rust
/// [`.foo()`](Self::foo)
```

if you want it to actually link. I think I found and replaced all of
these.

# User-Facing Changes

Just docs.
This commit is contained in:
Devyn Cairns
2024-07-27 19:39:29 -07:00
committed by GitHub
parent d80de68665
commit d618fd0527
15 changed files with 40 additions and 37 deletions

View File

@ -122,11 +122,11 @@ impl CommunicationMode {
/// The result of [`CommunicationMode::serve()`], which acts as an intermediate stage for
/// communication modes that require some kind of socket binding to occur before the client process
/// can be started. Call [`.connect()`] once the client process has been started.
/// can be started. Call [`.connect()`](Self::connect) once the client process has been started.
///
/// The socket may be cleaned up on `Drop` if applicable.
pub enum PreparedServerCommunication {
/// Will take stdin and stdout from the process on [`.connect()`].
/// Will take stdin and stdout from the process on [`.connect()`](Self::connect).
Stdio,
/// Contains the listener to accept connections on. On Unix, the socket is unlinked on `Drop`.
#[cfg(feature = "local-socket")]

View File

@ -145,7 +145,7 @@ pub trait InterfaceManager {
/// Consume an input message.
///
/// When implementing, call [`.consume_stream_message()`] for any encapsulated
/// When implementing, call [`.consume_stream_message()`](Self::consume_stream_message) for any encapsulated
/// [`StreamMessage`]s received.
fn consume(&mut self, input: Self::Input) -> Result<(), ShellError>;

View File

@ -189,14 +189,14 @@ where
}
/// Check if the stream was dropped from the other end. Recommended to do this before calling
/// [`.write()`], especially in a loop.
/// [`.write()`](Self::write), especially in a loop.
pub fn is_dropped(&self) -> Result<bool, ShellError> {
self.signal.is_dropped()
}
/// Write a single piece of data to the stream.
///
/// Error if something failed with the write, or if [`.end()`] was already called
/// Error if something failed with the write, or if [`.end()`](Self::end) was already called
/// previously.
pub fn write(&mut self, data: impl Into<StreamData>) -> Result<(), ShellError> {
if !self.ended {
@ -228,7 +228,7 @@ where
}
/// Write a full iterator to the stream. Note that this doesn't end the stream, so you should
/// still call [`.end()`].
/// still call [`.end()`](Self::end).
///
/// If the stream is dropped from the other end, the iterator will not be fully consumed, and
/// writing will terminate.
@ -341,8 +341,8 @@ impl StreamWriterSignal {
}
/// Track that a message has been sent. Returns `Ok(true)` if more messages can be sent,
/// or `Ok(false)` if the high pressure mark has been reached and [`.wait_for_drain()`] should
/// be called to block.
/// or `Ok(false)` if the high pressure mark has been reached and
/// [`.wait_for_drain()`](Self::wait_for_drain) should be called to block.
pub fn notify_sent(&self) -> Result<bool, ShellError> {
let mut state = self.lock()?;
state.unacknowledged =

View File

@ -45,7 +45,7 @@ fn fail_if_poisoned<'a, T>(
}
impl<T: Clone + Send> WaitableMut<T> {
/// Create a new empty `WaitableMut`. Call [`.reader()`] to get [`Waitable`].
/// Create a new empty `WaitableMut`. Call [`.reader()`](Self::reader) to get [`Waitable`].
pub fn new() -> WaitableMut<T> {
WaitableMut {
shared: Arc::new(WaitableShared {