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

Yuya Nishihara yuya at tcha.org
Sun Jul 21 02:56:14 EDT 2019


# HG changeset patch
# User Yuya Nishihara <yuya at 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

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()]
             }


More information about the Mercurial-devel mailing list