Skip to content

Commit eddb60f

Browse files
committed
refactor: repair clippy lints
1 parent 5c35432 commit eddb60f

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/cmd/import.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ fn import_tgz_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Pat
321321
let temp_dir = tempfile::tempdir()?;
322322
archive.unpack(temp_dir.path())?;
323323
let series_path = find_series_path(temp_dir.path())?;
324-
return import_series(stack, matches, Some(series_path.as_path()));
324+
import_series(stack, matches, Some(series_path.as_path()))
325325
}
326326

327327
fn import_tbz2_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Path) -> Result<()> {
@@ -330,7 +330,7 @@ fn import_tbz2_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Pa
330330
let temp_dir = tempfile::tempdir()?;
331331
archive.unpack(temp_dir.path())?;
332332
let series_path = find_series_path(temp_dir.path())?;
333-
return import_series(stack, matches, Some(series_path.as_path()));
333+
import_series(stack, matches, Some(series_path.as_path()))
334334
}
335335

336336
fn import_tar_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Path) -> Result<()> {
@@ -339,7 +339,7 @@ fn import_tar_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Pat
339339
let temp_dir = tempfile::tempdir()?;
340340
archive.unpack(temp_dir.path())?;
341341
let series_path = find_series_path(temp_dir.path())?;
342-
return import_series(stack, matches, Some(series_path.as_path()));
342+
import_series(stack, matches, Some(series_path.as_path()))
343343
}
344344

345345
fn import_series(

src/hook.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl<'repo> TemporaryMessage<'repo> {
188188
}
189189
}
190190

191-
impl<'repo> Drop for TemporaryMessage<'repo> {
191+
impl Drop for TemporaryMessage<'_> {
192192
fn drop(&mut self) {
193193
let msg_path = self.work_dir.join(&self.filename);
194194
if msg_path.is_file() {

src/patch/locator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ enum DisambiguatedId<'a> {
100100
FromLast(isize),
101101
}
102102

103-
impl<'a> DisambiguatedId<'a> {
103+
impl DisambiguatedId<'_> {
104104
fn string_for_error(&self) -> String {
105105
match self {
106106
DisambiguatedId::Name(name) => format!("`{name}`"),

src/stupid/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub(crate) struct StupidContext<'repo, 'index> {
3333
pub(super) git_version: RefCell<Option<StupidVersion>>,
3434
}
3535

36-
impl<'repo, 'index> StupidContext<'repo, 'index> {
36+
impl StupidContext<'_, '_> {
3737
/// Perform actions with a temporary index file.
3838
///
3939
/// The temporary index file is automatically deleted when this call returns.
@@ -56,7 +56,7 @@ impl<'repo, 'index> StupidContext<'repo, 'index> {
5656
}
5757
}
5858

59-
impl<'repo, 'index> StupidContext<'repo, 'index> {
59+
impl StupidContext<'_, '_> {
6060
fn git(&self) -> Command {
6161
let mut command = Command::new("git");
6262
self.setup_git_env(&mut command);
@@ -110,7 +110,7 @@ impl<'repo, 'index> StupidContext<'repo, 'index> {
110110
}
111111
}
112112

113-
impl<'repo, 'index> StupidContext<'repo, 'index> {
113+
impl StupidContext<'_, '_> {
114114
/// Apply a patch (diff) to the specified index using `git apply --cached`.
115115
pub(crate) fn apply_to_index(&self, diff: &BStr) -> Result<()> {
116116
self.git_in_work_root()?

src/stupid/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ impl<'s> Iterator for StatusIter<'s> {
396396

397397
pub(crate) struct StatusHeaders<'s>(&'s Statuses);
398398

399-
impl<'s> StatusHeaders<'s> {
399+
impl StatusHeaders<'_> {
400400
/// Get branch object id header.
401401
///
402402
/// Returns `None` if the initial commit has not been made for the branch.

src/stupid/tempindex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'repo> TempIndex<'repo> {
4545
}
4646
}
4747

48-
impl<'repo> Drop for TempIndex<'repo> {
48+
impl Drop for TempIndex<'_> {
4949
fn drop(&mut self) {
5050
let index_path = self.git_dir.join(self.filename());
5151
assert!(index_path.is_file());

src/wrap/message.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,19 @@ impl<'a> From<&'a str> for Message<'a> {
242242
}
243243
}
244244

245-
impl<'a> From<String> for Message<'a> {
245+
impl From<String> for Message<'_> {
246246
fn from(s: String) -> Self {
247247
Self::String(s)
248248
}
249249
}
250250

251-
impl<'a> Default for Message<'a> {
251+
impl Default for Message<'_> {
252252
fn default() -> Self {
253253
Self::Str("")
254254
}
255255
}
256256

257-
impl<'a> PartialEq for Message<'a> {
257+
impl PartialEq for Message<'_> {
258258
fn eq(&self, other: &Self) -> bool {
259259
self.raw_bytes() == other.raw_bytes()
260260
}

0 commit comments

Comments
 (0)