Skip to content

Commit

Permalink
refactor(lint): fix clippy::unnecessary_semicolon (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo authored Jan 31, 2025
1 parent aa28f98 commit 9563291
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/client_reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl AsyncTelegramApi for AsyncApi {
if let Some(params) = params {
let json_string = crate::json::encode(&params)?;
prepared_request = prepared_request.body(json_string);
};
}
let response = prepared_request.send().await?;
Self::decode_response(response).await
}
Expand Down
34 changes: 17 additions & 17 deletions src/trait_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ where
new_audio.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &audio.thumbnail {
let name = format!("file{file_idx}");
Expand All @@ -136,7 +136,7 @@ where
new_audio.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

new_medias.push(Media::Audio(new_audio));
}
Expand All @@ -152,7 +152,7 @@ where
new_document.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

new_medias.push(Media::Document(new_document));
}
Expand All @@ -167,7 +167,7 @@ where
new_photo.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

new_medias.push(Media::Photo(new_photo));
}
Expand All @@ -183,7 +183,7 @@ where
new_video.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &video.thumbnail {
let name = format!("file{file_idx}");
Expand All @@ -193,11 +193,11 @@ where
new_video.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

new_medias.push(Media::Video(new_video));
}
};
}
}

let mut new_params = params.clone();
Expand Down Expand Up @@ -402,7 +402,7 @@ where
new_animation.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &animation.thumbnail {
let name = "animation_thumb".to_string();
Expand All @@ -411,7 +411,7 @@ where
new_animation.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

InputMedia::Animation(new_animation)
}
Expand All @@ -425,7 +425,7 @@ where
new_document.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &document.thumbnail {
let name = "document_thumb".to_string();
Expand All @@ -434,7 +434,7 @@ where
new_document.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

InputMedia::Document(new_document)
}
Expand All @@ -448,7 +448,7 @@ where
new_audio.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &audio.thumbnail {
let name = "audio_thumb".to_string();
Expand All @@ -457,7 +457,7 @@ where
new_audio.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

InputMedia::Audio(new_audio)
}
Expand All @@ -471,7 +471,7 @@ where
new_photo.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

InputMedia::Photo(new_photo)
}
Expand All @@ -485,7 +485,7 @@ where
new_video.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &video.thumbnail {
let name = "video_thumb".to_string();
Expand All @@ -494,7 +494,7 @@ where
new_video.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

InputMedia::Video(new_video)
}
Expand Down Expand Up @@ -568,7 +568,7 @@ where
new_sticker.sticker = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

new_stickers.push(new_sticker);
}
Expand Down
34 changes: 17 additions & 17 deletions src/trait_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub trait TelegramApi {
new_audio.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &audio.thumbnail {
let name = format!("file{file_idx}");
Expand All @@ -120,7 +120,7 @@ pub trait TelegramApi {
new_audio.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

new_medias.push(Media::Audio(new_audio));
}
Expand All @@ -136,7 +136,7 @@ pub trait TelegramApi {
new_document.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

new_medias.push(Media::Document(new_document));
}
Expand All @@ -151,7 +151,7 @@ pub trait TelegramApi {
new_photo.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

new_medias.push(Media::Photo(new_photo));
}
Expand All @@ -167,7 +167,7 @@ pub trait TelegramApi {
new_video.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &video.thumbnail {
let name = format!("file{file_idx}");
Expand All @@ -177,11 +177,11 @@ pub trait TelegramApi {
new_video.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

new_medias.push(Media::Video(new_video));
}
};
}
}

let mut new_params = params.clone();
Expand Down Expand Up @@ -373,7 +373,7 @@ pub trait TelegramApi {
new_animation.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &animation.thumbnail {
let name = "animation_thumb".to_string();
Expand All @@ -382,7 +382,7 @@ pub trait TelegramApi {
new_animation.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

InputMedia::Animation(new_animation)
}
Expand All @@ -396,7 +396,7 @@ pub trait TelegramApi {
new_document.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &document.thumbnail {
let name = "document_thumb".to_string();
Expand All @@ -405,7 +405,7 @@ pub trait TelegramApi {
new_document.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

InputMedia::Document(new_document)
}
Expand All @@ -419,7 +419,7 @@ pub trait TelegramApi {
new_audio.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &audio.thumbnail {
let name = "audio_thumb".to_string();
Expand All @@ -428,7 +428,7 @@ pub trait TelegramApi {
new_audio.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

InputMedia::Audio(new_audio)
}
Expand All @@ -442,7 +442,7 @@ pub trait TelegramApi {
new_photo.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

InputMedia::Photo(new_photo)
}
Expand All @@ -456,7 +456,7 @@ pub trait TelegramApi {
new_video.media = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

if let Some(FileUpload::InputFile(input_file)) = &video.thumbnail {
let name = "video_thumb".to_string();
Expand All @@ -465,7 +465,7 @@ pub trait TelegramApi {
new_video.thumbnail = Some(FileUpload::String(attach_name));

files.push((name, input_file.path.clone()));
};
}

InputMedia::Video(new_video)
}
Expand Down Expand Up @@ -536,7 +536,7 @@ pub trait TelegramApi {
new_sticker.sticker = FileUpload::String(attach_name);

files.push((name, input_file.path.clone()));
};
}

new_stickers.push(new_sticker);
}
Expand Down

0 comments on commit 9563291

Please sign in to comment.