use char instead of &str for single char patterns

This commit is contained in:
Matthias Krüger
2020-02-26 13:03:46 +01:00
parent a8437cf213
commit 7c84ba1124
30 changed files with 44 additions and 44 deletions

View File

@@ -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,

View 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;