clippy fixes

This commit is contained in:
Nikita Galaiko 2023-10-13 11:07:38 +02:00 committed by GitButler
parent 00a631fd2d
commit a589b934a2
6 changed files with 8 additions and 11 deletions

View File

@ -26,7 +26,7 @@ impl super::RunCommand for Info {
// find the project in project storage that matches the cwd
println!("{}", "project:".to_string().red());
println!(" id: {}", app.project().id.blue());
println!(" id: {}", app.project().id.to_string().blue());
println!(" title: {}", app.project().title.blue());
println!(
" description: {}",
@ -77,7 +77,7 @@ impl super::RunCommand for Info {
.unwrap();
//list the sessions
for session in &sessions {
println!(" id: {}", session.id.blue());
println!(" id: {}", session.id.to_string().blue());
}
// gitbutler repo stuff

View File

@ -7,7 +7,7 @@ pub struct Id<T>(Uuid, PhantomData<T>);
impl<T> Hash for Id<T> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.0.hash(state)
self.0.hash(state);
}
}
@ -71,7 +71,7 @@ impl<T> Serialize for Id<T> {
impl<T> Clone for Id<T> {
fn clone(&self) -> Self {
Self(self.0, PhantomData)
*self
}
}

View File

@ -71,7 +71,7 @@ impl Dispatcher {
.name(&format!("{} file watcher", project_id))
.spawn({
let path = path.to_path_buf();
let project_id = project_id.clone();
let project_id = *project_id;
async move {
while let Some(file_path) = notify_rx.recv().await {
match file_path.strip_prefix(&path) {

View File

@ -57,7 +57,7 @@ impl Dispatcher {
))?;
let (tx, rx) = channel(1);
let project_id = project_id.to_owned();
let project_id = *project_id;
task::Builder::new()
.name(&format!("{} dispatcher", project_id))
.spawn(async move {

View File

@ -71,10 +71,7 @@ impl Handler {
.get_current_session()
.context("failed to get current session")?
{
return Ok(vec![events::Event::Flush(
project.id.clone(),
current_session,
)]);
return Ok(vec![events::Event::Flush(project.id, current_session)]);
}
}

View File

@ -41,7 +41,7 @@ impl Watchers {
let watcher = Watcher::try_from(&self.app_handle)?;
let c_watcher = watcher.clone();
let project_id = project.id.clone();
let project_id = project.id;
let project_path = project.path.clone();
task::Builder::new()