Replace MultiBuffer::files with ::for_each_buffer

This commit is contained in:
Max Brunsfeld 2023-01-17 16:13:26 -08:00
parent f61b870db6
commit 292708573f
3 changed files with 14 additions and 14 deletions

View file

@ -565,12 +565,14 @@ impl Item for Editor {
}
fn project_entry_ids(&self, cx: &AppContext) -> SmallVec<[ProjectEntryId; 3]> {
self.buffer
.read(cx)
.files(cx)
.into_iter()
.filter_map(|file| File::from_dyn(Some(file))?.project_entry_id(cx))
.collect()
let mut result = SmallVec::new();
self.buffer.read(cx).for_each_buffer(|buffer| {
let buffer = buffer.read(cx);
if let Some(file) = File::from_dyn(buffer.file()) {
result.extend(file.project_entry_id(cx));
}
});
result
}
fn is_singleton(&self, cx: &AppContext) -> bool {