Commit 194dd379 authored by Jens Getreu's avatar Jens Getreu

use separators in long literals

parent 81a18040
Pipeline #94458658 passed with stage
in 3 minutes and 16 seconds
......@@ -473,12 +473,12 @@ mod tests {
static M1: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......@@ -515,12 +515,12 @@ mod tests {
static M2: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......@@ -558,12 +558,12 @@ mod tests {
static M3: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......@@ -600,12 +600,12 @@ mod tests {
static M4: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......@@ -642,12 +642,12 @@ mod tests {
static M5: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......@@ -685,12 +685,12 @@ mod tests {
static M6: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......@@ -728,12 +728,12 @@ mod tests {
static M7: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......@@ -770,12 +770,12 @@ mod tests {
static M8: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......@@ -818,12 +818,12 @@ mod tests {
static M9: Mission = Mission {
encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
filter2: UnicodeBlockFilter {
and_mask: 0xffe00000,
and_mask: 0xffe0_0000,
and_result: 0,
is_some: false,
},
......
......@@ -38,7 +38,7 @@ pub struct UnicodeBlockFilter {
/// Is this `and_mask`, `and_result` filtering anything?
/// This information is redundant because:
/// `is_some = (and_mask == 0xffe00000) && (and_result == 0x0)`
/// `is_some = (and_mask == 0xffe0_0000) && (and_result == 0x0)`
/// It is precalculated to speed up later operations.
pub is_some: bool,
}
......@@ -47,7 +47,7 @@ pub struct UnicodeBlockFilter {
impl UnicodeBlockFilter {
/// This constructs a non-restricting filter letting pass all characters.
pub fn new() -> Self {
// This calculates: 0xffe00000
// This calculates: 0xffe0_0000
let and_mask_all = !((std::char::MAX as u32).next_power_of_two() - 1);
UnicodeBlockFilter {
and_mask: and_mask_all,
......@@ -302,7 +302,7 @@ impl Missions {
let u_and_result = u_lower_ext;
// Check if the filter is restrictive
// filtering = (and_mask == 0xffe00000) && (and_result == 0x0)
// filtering = (and_mask == 0xffe0_0000) && (and_result == 0x0)
let filtering = !(u_and_mask == !((std::char::MAX as u32).next_power_of_two() - 1)
&& u_and_result == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment