Skip to content

Commit 8906020

Browse files
authored
Fix clippy error within 1.90.0 (#1466)
* Fix clippy error within 1.90.0 Signed-off-by: Quanyi Ma <eli@patch.sh> * Fix clippy error within 1.90.0 Signed-off-by: Quanyi Ma <eli@patch.sh> --------- Signed-off-by: Quanyi Ma <eli@patch.sh>
1 parent 76dbd1d commit 8906020

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

mercury/src/internal/index.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ pub struct Index {
205205
}
206206

207207
impl Index {
208+
pub fn new() -> Self {
209+
Index {
210+
entries: BTreeMap::new(),
211+
}
212+
}
213+
208214
fn check_header(file: &mut impl Read) -> Result<u32, GitError> {
209215
let mut magic = [0; 4];
210216
file.read_exact(&mut magic)?;
@@ -224,12 +230,6 @@ impl Index {
224230
Ok(entries)
225231
}
226232

227-
pub fn new() -> Self {
228-
Index {
229-
entries: BTreeMap::new(),
230-
}
231-
}
232-
233233
pub fn size(&self) -> usize {
234234
self.entries.len()
235235
}
@@ -400,6 +400,12 @@ impl Index {
400400
}
401401
}
402402

403+
impl Default for Index {
404+
fn default() -> Self {
405+
Self::new()
406+
}
407+
}
408+
403409
impl Index {
404410
/// Load index. If it does not exist, return an empty index.
405411
pub fn load(index_file: impl AsRef<Path>) -> Result<Self, GitError> {

mercury/src/internal/pack/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ impl Pack {
478478
/// <br> Attention: It will consume the `pack` and return in a JoinHandle.
479479
pub fn decode_async(
480480
mut self,
481-
mut pack: (impl BufRead + Send + 'static),
481+
mut pack: impl BufRead + Send + 'static,
482482
sender: UnboundedSender<Entry>,
483483
) -> JoinHandle<Pack> {
484484
thread::spawn(move || {

mono/src/api/mr/model.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
2+
#[allow(dead_code)]
23
pub struct VerifyMrPayload {
34
pub assignees: Vec<String>,
45
}

0 commit comments

Comments
 (0)