Patchwork [5,of,6] rust-filepatterns: use literal b'#' instead of cast

login
register
mail settings
Submitter Yuya Nishihara
Date July 21, 2019, 6:56 a.m.
Message ID <aa50f3ab3c8b106c16ac.1563692174@mimosa>
Download mbox | patch
Permalink /patch/40989/
State Accepted
Headers show

Comments

Yuya Nishihara - July 21, 2019, 6:56 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1563681654 -32400
#      Sun Jul 21 13:00:54 2019 +0900
# Node ID aa50f3ab3c8b106c16ac1d60772cd5a1eedb6d0a
# Parent  adb7bc2932816deff985967f42837391c0977b06
rust-filepatterns: use literal b'#' instead of cast

Patch

diff --git a/rust/hg-core/src/filepatterns.rs b/rust/hg-core/src/filepatterns.rs
--- a/rust/hg-core/src/filepatterns.rs
+++ b/rust/hg-core/src/filepatterns.rs
@@ -243,7 +243,7 @@  pub fn parse_pattern_file_contents(
     for (line_number, mut line) in lines.split(|c| *c == b'\n').enumerate() {
         let line_number = line_number + 1;
 
-        if line.contains(&('#' as u8)) {
+        if line.contains(&b'#') {
             if let Some(cap) = comment_regex.captures(line) {
                 line = &line[..cap.get(1).unwrap().end()]
             }