Ran bless and rustfmt

This commit is contained in:
boolean_coercion 2021-02-11 12:46:11 +02:00
parent 0b31b470ad
commit d1a627ab3b
3 changed files with 42 additions and 8 deletions

View File

@ -1,8 +1,8 @@
use rustc_lint::{LateLintPass, LateContext};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_hir::*;
use rustc_errors::Applicability;
use if_chain::if_chain;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::span_lint_and_sugg;
@ -16,7 +16,7 @@
/// and complexity.
///
/// **Known problems:** None.
///
///
/// **Example:**
///
/// ```rust
@ -77,6 +77,6 @@ fn is_primitive_integer_ty(ty: PrimTy) -> bool {
match ty {
PrimTy::Int(_) => true,
PrimTy::Uint(_) => true,
_ => false
_ => false,
}
}
}

View File

@ -33,4 +33,4 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
from_str_radix("50", 6)?;
Ok(())
}
}

View File

@ -0,0 +1,34 @@
error: This call to `from_str_radix` can be shortened to a call to str::parse
--> $DIR/from_str_radix_10.rs:17:5
|
LL | u32::from_str_radix("30", 10)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `("30").parse()`
|
= note: `-D clippy::from-str-radix-10` implied by `-D warnings`
error: This call to `from_str_radix` can be shortened to a call to str::parse
--> $DIR/from_str_radix_10.rs:18:5
|
LL | i64::from_str_radix("24", 10)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `("24").parse()`
error: This call to `from_str_radix` can be shortened to a call to str::parse
--> $DIR/from_str_radix_10.rs:19:5
|
LL | isize::from_str_radix("100", 10)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `("100").parse()`
error: This call to `from_str_radix` can be shortened to a call to str::parse
--> $DIR/from_str_radix_10.rs:20:5
|
LL | u8::from_str_radix("7", 10)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `("7").parse()`
error: This call to `from_str_radix` can be shortened to a call to str::parse
--> $DIR/from_str_radix_10.rs:23:5
|
LL | i32::from_str_radix(string, 10)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(string).parse()`
error: aborting due to 5 previous errors