Reduce amount of monomorphizations from FnMut closures (#49453)
Replaces a bunch of `impl FnMut` parameters with `&mut dyn FnMut` for functions where this is the sole generic parameter. Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
1 parent
a3d5f56be8
commit
2fb5628281
80 files changed
+482
-428
No files matched your search
@@ -2563,7 +2563,7 @@ impl MultiBuffer {
|
||||
language_settings(language.map(|l| l.name()), file, cx)
|
||||
}
|
||||
|
||||
pub fn for_each_buffer(&self, mut f: impl FnMut(&Entity<Buffer>)) {
|
||||
pub fn for_each_buffer(&self, f: &mut dyn FnMut(&Entity<Buffer>)) {
|
||||
self.buffers.values().for_each(|state| f(&state.buffer))
|
||||
}
|
||||
|
||||
@@ -4978,7 +4978,7 @@ impl MultiBufferSnapshot {
|
||||
let mut result = BTreeMap::new();
|
||||
self.suggested_indents_callback(
|
||||
rows,
|
||||
|row, indent| {
|
||||
&mut |row, indent| {
|
||||
result.insert(row, indent);
|
||||
ControlFlow::Continue(())
|
||||
},
|
||||
@@ -4991,7 +4991,7 @@ impl MultiBufferSnapshot {
|
||||
pub fn suggested_indents_callback(
|
||||
&self,
|
||||
rows: impl IntoIterator<Item = u32>,
|
||||
mut cb: impl FnMut(MultiBufferRow, IndentSize) -> ControlFlow<()>,
|
||||
cb: &mut dyn FnMut(MultiBufferRow, IndentSize) -> ControlFlow<()>,
|
||||
cx: &App,
|
||||
) {
|
||||
let mut rows_for_excerpt = Vec::new();
|
||||
|
||||
Reference in new issue
Block a user