formatting fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-08-28 09:00:43 +02:00
parent 54ab179254
commit 51f5c11e2b

View File

@ -360,11 +360,7 @@ pub trait MatchList {
fn matches_do(&self, path: &[u8], file_mode: Option<u32>) -> Option<MatchType>; fn matches_do(&self, path: &[u8], file_mode: Option<u32>) -> Option<MatchType>;
/// Check whether this list contains anything exactly matching the path and mode. /// Check whether this list contains anything exactly matching the path and mode.
fn matches_exact<T: AsRef<[u8]>>( fn matches_exact<T: AsRef<[u8]>>(&self, path: T, file_mode: Option<u32>) -> Option<MatchType> {
&self,
path: T,
file_mode: Option<u32>,
) -> Option<MatchType> {
self.matches_exact_do(path.as_ref(), file_mode) self.matches_exact_do(path.as_ref(), file_mode)
} }
@ -429,8 +425,7 @@ fn assert_containers_implement_match_list() {
#[test] #[test]
fn test_file_type_matches() { fn test_file_type_matches() {
let matchlist = vec![ let matchlist = vec![
MatchEntry::parse_pattern("a_dir/", PatternFlag::PATH_NAME, MatchType::Include) MatchEntry::parse_pattern("a_dir/", PatternFlag::PATH_NAME, MatchType::Include).unwrap(),
.unwrap(),
MatchEntry::parse_pattern("!a_file", PatternFlag::PATH_NAME, MatchType::Include) MatchEntry::parse_pattern("!a_file", PatternFlag::PATH_NAME, MatchType::Include)
.unwrap() .unwrap()
.flags(MatchFlag::MATCH_REGULAR_FILES), .flags(MatchFlag::MATCH_REGULAR_FILES),
@ -487,8 +482,9 @@ fn test_anchored_matches() {
#[test] #[test]
fn test_literal_matches() { fn test_literal_matches() {
let matchlist = vec![ let matchlist = vec![MatchEntry::new(
MatchEntry::new(MatchPattern::Literal(b"/bin/mv".to_vec()), MatchType::Include), MatchPattern::Literal(b"/bin/mv".to_vec()),
]; MatchType::Include,
)];
assert_eq!(matchlist.matches("/bin/mv", None), Some(MatchType::Include)); assert_eq!(matchlist.matches("/bin/mv", None), Some(MatchType::Include));
} }