equal
deleted
inserted
replaced
123 fn add_trusted_dir(&mut self, path: &Path) -> Result<(), ConfigError> { |
123 fn add_trusted_dir(&mut self, path: &Path) -> Result<(), ConfigError> { |
124 if let Some(entries) = std::fs::read_dir(path) |
124 if let Some(entries) = std::fs::read_dir(path) |
125 .when_reading_file(path) |
125 .when_reading_file(path) |
126 .io_not_found_as_none()? |
126 .io_not_found_as_none()? |
127 { |
127 { |
128 for entry in entries { |
128 let mut file_paths = entries |
129 let file_path = entry.when_reading_file(path)?.path(); |
129 .map(|result| { |
|
130 result.when_reading_file(path).map(|entry| entry.path()) |
|
131 }) |
|
132 .collect::<Result<Vec<_>, _>>()?; |
|
133 file_paths.sort(); |
|
134 for file_path in &file_paths { |
130 if file_path.extension() == Some(std::ffi::OsStr::new("rc")) { |
135 if file_path.extension() == Some(std::ffi::OsStr::new("rc")) { |
131 self.add_trusted_file(&file_path)? |
136 self.add_trusted_file(&file_path)? |
132 } |
137 } |
133 } |
138 } |
134 } |
139 } |