Commit 5ee1e951 authored by Jens Getreu's avatar Jens Getreu

simplify expressions

parent 996db0c4
......@@ -219,7 +219,7 @@ impl PartialOrd for Finding<'_> {
impl<'a> Finding<'a> {
pub fn print(&self, out: &mut dyn Write) -> Result<(), Box<std::io::Error>> {
out.write_all("\n".as_bytes())?;
out.write_all(b"\n")?;
if !ARGS.no_metadata {
if ARGS.inputs.len() > 1 {
if let Some(i) = self.input_file_id {
......@@ -241,9 +241,9 @@ impl<'a> Finding<'a> {
None => {}
};
if self.s_completes_previous_s {
out.write_all("+\t".as_bytes())?
out.write_all(b"+\t")?
} else {
out.write_all(" \t".as_bytes())?
out.write_all(b" \t")?
};
}
......
......@@ -419,14 +419,14 @@ impl<'a> Iterator for SplitStr<'a> {
self.last_s_was_maybe_cut = s_is_maybe_cut;
// Return results
return Some(SplitStrResult {
Some(SplitStrResult {
s: ok_s,
s_completes_previous_s,
s_is_maybe_cut,
s_is_to_be_filtered_again,
s_satisfies_min_char_rule,
s_satisfies_grep_char_rule,
});
})
}
}
......
......@@ -628,20 +628,21 @@ impl Missions {
// "x-user-defined" and the `UTF8_FILTER_ASCII_MODE_DEFAULT`-filter,
// if not otherwise specified.
let filter_af =
filter_af.unwrap_or(flag_ascii_filter.unwrap_or(if enc_name == ASCII_ENC_LABEL {
let filter_af = filter_af.unwrap_or_else(|| {
flag_ascii_filter.unwrap_or(if enc_name == ASCII_ENC_LABEL {
UTF8_FILTER_ASCII_MODE_DEFAULT.af
} else {
UTF8_FILTER_NON_ASCII_MODE_DEFAULT.af
}));
})
});
let filter_ubf = filter_ubf.unwrap_or(flag_unicode_block_filter.unwrap_or(
if enc_name == ASCII_ENC_LABEL {
let filter_ubf = filter_ubf.unwrap_or_else(|| {
flag_unicode_block_filter.unwrap_or(if enc_name == ASCII_ENC_LABEL {
UTF8_FILTER_ASCII_MODE_DEFAULT.ubf
} else {
UTF8_FILTER_NON_ASCII_MODE_DEFAULT.ubf
},
));
})
});
let filter_grep_char = match filter_grep_char {
Some(f) => Some(f),
......
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