| ... | ... | @@ -796,14 +796,15 @@ impl Library { |
| 796 | 796 | ) -> Result<Section, Box<dyn Error>> { |
| 797 | 797 | // The background may hold the replica for a step, which takes a network round trip, |
| 798 | 798 | // or be making it as an offline copy. |
| 799 | | self.open_by(path, notify, Instant::now() + TIMEOUT * 3) |
| 799 | self.open_by(path, Box::new(notify), Instant::now() + TIMEOUT * 3) |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | | /// `open`, waiting until `deadline` for whatever holds the section's replica. |
| 802 | /// `open`, waiting until `deadline` for whatever holds the section's replica. `notify` is |
| 803 | /// boxed to compile this once rather than once per caller's closure. |
| 803 | 804 | fn open_by( |
| 804 | 805 | &self, |
| 805 | 806 | path: &str, |
| 806 | | notify: impl Fn() + Send + 'static, |
| 807 | notify: Box<dyn Fn() + Send>, |
| 807 | 808 | deadline: Instant, |
| 808 | 809 | ) -> Result<Section, Box<dyn Error>> { |
| 809 | 810 | let notify = Arc::new(Mutex::new(notify)); |
| ... | ... | @@ -901,7 +902,7 @@ impl Library { |
| 901 | 902 | path: &str, |
| 902 | 903 | notify: impl Fn() + Send + 'static, |
| 903 | 904 | ) -> Result<Arc<notebook::Replica>, Box<dyn Error>> { |
| 904 | | let section = self.open_by(path, notify, Instant::now())?; |
| 905 | let section = self.open_by(path, Box::new(notify), Instant::now())?; |
| 905 | 906 | let replica = Arc::clone(section.replica()); |
| 906 | 907 | self.keep(path, section); |
| 907 | 908 | Ok(replica) |