@@ -70,6 +70,8 @@ impl From<DocumentId> for PathOrId {
7070 }
7171}
7272
73+type FileCallback<T> = Box<dyn Fn(&Editor, &T) -> Option<FileLocation>>;
74+
7375/// File path and range of lines (used to align and highlight lines)
7476pub type FileLocation = (PathOrId, Option<(usize, usize)>);
7577
@@ -80,7 +82,7 @@ pub struct FilePicker<T: Item> {
8082 preview_cache: HashMap<PathBuf, CachedPreview>,
8183 read_buffer: Vec<u8>,
8284 /// Given an item in the picker, return the file path and line number to display.
83− file_fn: Box<dyn Fn(&Editor, &T) -> Option<FileLocation>>,
85+ file_fn: FileCallback<T>,
8486}
8587
8688pub enum CachedPreview {
@@ -394,6 +396,8 @@ impl Ord for PickerMatch {
394396 }
395397}
396398
399+type PickerCallback<T> = Box<dyn Fn(&mut Context, &T, Action)>;
400+
397401pub struct Picker<T: Item> {
398402 options: Vec<T>,
399403 editor_data: T::Data,
@@ -415,7 +419,7 @@ pub struct Picker<T: Item> {
415419 /// Constraints for tabular formatting
416420 widths: Vec<Constraint>,
417421
418− callback_fn: Box<dyn Fn(&mut Context, &T, Action)>,
422+ callback_fn: PickerCallback<T>,
419423}
420424
421425impl<T: Item> Picker<T> {