Skip to content

Commit

Permalink
Run cargo fmt against richclip.
Browse files Browse the repository at this point in the history
  • Loading branch information
higuoxing authored and beeender committed Jan 8, 2025
1 parent fd8b617 commit 8b72110
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/clipboard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct CopyConfig<T: SourceData> {
pub use_primary: bool,
pub source_data: T,
// For testing X INCR mode
pub x_chunk_size: usize
pub x_chunk_size: usize,
}

pub use wayland::{copy_wayland, paste_wayland};
Expand Down
7 changes: 3 additions & 4 deletions src/clipboard/wayland.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::mime_type::decide_mime_type;
use super::PasteConfig;
use super::CopyConfig;
use super::PasteConfig;
use crate::protocol::SourceData;
use anyhow::{Context, Error, Result, bail};
use anyhow::{bail, Context, Error, Result};
use std::collections::HashMap;
use std::ffi::CString;
use std::fs::File;
Expand Down Expand Up @@ -266,8 +266,7 @@ fn wl_source_cb_for_copy(ctx: EventCtx<CopyEventState, ZwlrDataControlSourceV1>)
log::debug!("Received 'Send' event");
let src_data = ctx.state.source_data;
let mut file = File::from(fd);
let (_, content) = src_data
.content_by_mime_type(mime_type.to_str().unwrap());
let (_, content) = src_data.content_by_mime_type(mime_type.to_str().unwrap());
file.write_all(&content).unwrap();
}
zwlr_data_control_source_v1::Event::Cancelled => {
Expand Down
6 changes: 3 additions & 3 deletions src/protocol/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod source_data;
mod recv;
mod source_data;

pub use source_data::SourceData;
pub use recv::receive_data;
#[allow(unused_imports)]
pub use recv::PROTOCAL_VER;
pub use recv::receive_data;
pub use source_data::SourceData;
2 changes: 1 addition & 1 deletion src/protocol/recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn receive_data(mut reader: impl Read) -> Result<Vec<SourceDataItem>> {
let content = read_content(&mut reader)?;
ret.push(SourceDataItem {
mime_type: type_list,
content: content.into()
content: content.into(),
});
type_list = Vec::new();
}
Expand Down

0 comments on commit 8b72110

Please sign in to comment.