Skip to content

Commit 53d44ac

Browse files
rami3ldjc
authored andcommitted
Add Panics sections to docstrings
1 parent 7f86b75 commit 53d44ac

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/dist/dist.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ static TOOLCHAIN_CHANNELS: &[&str] = &[
4343
r"\d{1}\.\d{1,3}(?:\.\d{1,2})?",
4444
];
4545

46+
/// Returns a error message indicating that certain [`Component`]s are missing in a toolchain distribution.
47+
///
48+
/// This message is currently used exclusively in toolchain-wide operations,
49+
/// otherwise [`component_unavailable_msg`](../../errors/fn.component_unavailable_msg.html) will be used.
50+
///
51+
/// # Panics
52+
/// This function will panic when the collection of unavailable components `cs` is empty.
4653
fn components_missing_msg(cs: &[Component], manifest: &ManifestV2, toolchain: &str) -> String {
4754
let mut buf = vec![];
4855
let suggestion = format!(" rustup toolchain add {toolchain} --profile minimal");

src/errors.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ fn suggest_message(suggestion: &Option<String>) -> String {
147147
}
148148
}
149149

150+
/// Returns a error message indicating that certain [`Component`]s are unavailable.
151+
///
152+
/// See also [`component_missing_msg`](../dist/dist/fn.components_missing_msg.html)
153+
/// which generates error messages for component unavailability toolchain-wide operations.
154+
///
155+
/// # Panics
156+
/// This function will panic when the collection of unavailable components `cs` is empty.
150157
fn component_unavailable_msg(cs: &[Component], manifest: &Manifest, toolchain: &str) -> String {
151158
let mut buf = vec![];
152159
match cs {

0 commit comments

Comments
 (0)