Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
kenchou committed Jun 14, 2024
1 parent bc613c3 commit 2291e1b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wezterm-gui/src/overlay/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ impl CopyOverlay {
render.update_search();

let shared_render = Arc::new(Mutex::new(render));
let writer = SearchOverlayPatternWriter {render: Arc::clone(&shared_render)};
let writer = SearchOverlayPatternWriter {
render: Arc::clone(&shared_render),
};

Ok(Arc::new(CopyOverlay {
delegate: Arc::clone(pane),
Expand Down Expand Up @@ -1522,7 +1524,9 @@ pub struct SearchOverlayPatternWriter {
impl std::io::Write for SearchOverlayPatternWriter {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
let mut render = self.render.lock();
let s = std::str::from_utf8(buf).map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, format!("invalid UTF-8: {err:#}")))?;
let s = std::str::from_utf8(buf).map_err(|err| {
std::io::Error::new(std::io::ErrorKind::Other, format!("invalid UTF-8: {err:#}"))
})?;
render.pattern.push_str(s);
render.schedule_update_search();
Ok(buf.len())
Expand Down

0 comments on commit 2291e1b

Please sign in to comment.