use char instead of &str for single char patterns
This commit is contained in:
@@ -4,7 +4,7 @@ use std::fs;
|
||||
use std::io;
|
||||
|
||||
pub fn arg_expand(arg: String) -> Result<Vec<String>, Error> {
|
||||
if arg.starts_with("@") {
|
||||
if arg.starts_with('@') {
|
||||
let path = &arg[1..];
|
||||
let file = match fs::read_to_string(path) {
|
||||
Ok(file) => file,
|
||||
|
||||
@@ -521,7 +521,7 @@ fn stdout_isatty() -> bool {
|
||||
|
||||
fn handle_explain(registry: Registry, code: &str, output: ErrorOutputType) {
|
||||
let normalised =
|
||||
if code.starts_with("E") { code.to_string() } else { format!("E{0:0>4}", code) };
|
||||
if code.starts_with('E') { code.to_string() } else { format!("E{0:0>4}", code) };
|
||||
match registry.find_description(&normalised) {
|
||||
Some(ref description) => {
|
||||
let mut is_in_code_block = false;
|
||||
|
||||
Reference in New Issue
Block a user