address or allow clippy::missing_panics_doc in clippy-dev

This commit is contained in:
Kisaragi Marine 2023-06-14 22:26:10 +09:00
parent 2fa72c7dfe
commit aff9c01ab9
No known key found for this signature in database
GPG key ID: 62B80306B822AE9E
3 changed files with 8 additions and 0 deletions

View file

@ -35,6 +35,7 @@ struct FmtContext {
}
// the "main" function of cargo dev fmt
#[allow(clippy::missing_panics_doc)]
pub fn run(check: bool, verbose: bool) {
fn try_run(context: &FmtContext) -> Result<bool, CliError> {
let mut success = true;

View file

@ -29,6 +29,10 @@ static CARGO_CLIPPY_EXE: &str = "cargo-clippy";
static CARGO_CLIPPY_EXE: &str = "cargo-clippy.exe";
/// Returns the path to the `cargo-clippy` binary
///
/// # Panics
///
/// Panics if the path of current executable could not be retrieved.
#[must_use]
pub fn cargo_clippy_path() -> PathBuf {
let mut path = std::env::current_exe().expect("failed to get current executable name");
@ -61,6 +65,8 @@ pub fn clippy_project_root() -> PathBuf {
panic!("error: Can't determine root of project. Please run inside a Clippy working dir.");
}
/// # Panics
/// Panics if given command result was failed.
pub fn exit_if_err(status: io::Result<ExitStatus>) {
match status.expect("failed to run command").code() {
Some(0) => {},

View file

@ -36,6 +36,7 @@ impl<T> Context for io::Result<T> {
/// # Errors
///
/// This function errors out if the files couldn't be created or written to.
#[allow(clippy::missing_panics_doc)]
pub fn create(
pass: &String,
lint_name: Option<&String>,