Fix clippy lints.

This commit is contained in:
Tom Alexander
2024-09-29 14:08:05 -04:00
parent ef195cd4df
commit cdac8224c6
7 changed files with 41 additions and 17 deletions

View File

@@ -37,7 +37,7 @@ impl GiteaClient {
owner = owner.as_ref(),
repo = repo.as_ref(),
commit = commit.as_ref(),
page = page.map(|num| format!("&page={}", num)).unwrap_or_else(|| String::new())
page = page.map(|num| format!("&page={}", num)).unwrap_or_default()
);
let response = self
.http_client
@@ -99,11 +99,18 @@ impl GiteaClient {
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
struct ResponseGetTree {
#[allow(dead_code)]
sha: String,
#[allow(dead_code)]
url: String,
tree: Vec<ResponseObjectReference>,
#[allow(dead_code)]
truncated: bool,
page: u64,
#[allow(dead_code)]
total_count: u64,
}
@@ -111,10 +118,18 @@ struct ResponseGetTree {
#[serde(deny_unknown_fields)]
struct ResponseObjectReference {
path: String,
#[allow(dead_code)]
mode: String,
#[allow(dead_code)]
#[serde(rename = "type")]
object_type: String,
#[allow(dead_code)]
size: u64,
#[allow(dead_code)]
sha: String,
url: String,
}
@@ -150,7 +165,13 @@ impl TreeFileReference {
struct ResponseReadFile {
content: String,
encoding: String,
#[allow(dead_code)]
url: String,
#[allow(dead_code)]
sha: String,
#[allow(dead_code)]
size: u64,
}