mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
address or allow clippy::missing_panics_doc in clippy-dev
This commit is contained in:
parent
2fa72c7dfe
commit
aff9c01ab9
3 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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) => {},
|
||||
|
|
|
@ -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>,
|
||||
|
|
Loading…
Reference in a new issue