Skip to content

Commit 425fd57

Browse files
committed
thanks clippy (#26)
1 parent d059360 commit 425fd57

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/index/diff/delegate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl Delegate {
3535
match change.event {
3636
Addition { entry_mode, id } => {
3737
if let Some(obj) = entry_data(entry_mode, id)? {
38-
for line in (&obj.data).lines() {
38+
for line in obj.data.lines() {
3939
let version = version_from_json_line(line, change.location)?;
4040
self.changes.push(if version.yanked {
4141
Change::Yanked(version)
@@ -140,7 +140,7 @@ impl Delegate {
140140
},
141141
);
142142
if let Some(err) = err {
143-
return Err(err.into());
143+
return Err(err);
144144
}
145145
}
146146
}

src/index/diff/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,12 @@ impl Index {
9797
.ok()
9898
.and_then(|head| {
9999
head.into_remote(git::remote::Direction::Fetch)
100-
.map(|r| r.ok())
101-
.flatten()
100+
.and_then(|r| r.ok())
102101
})
103102
.or_else(|| {
104103
self.repo
105104
.find_default_remote(git::remote::Direction::Fetch)
106-
.map(|r| r.ok())
107-
.flatten()
105+
.and_then(|r| r.ok())
108106
})
109107
})
110108
})
@@ -146,7 +144,7 @@ impl Index {
146144
.iter()
147145
.find_map(|m| match &m.remote {
148146
git::remote::fetch::Source::Ref(r) => (r.unpack().0 == branch_name)
149-
.then(|| m.local.as_ref())
147+
.then_some(m.local.as_ref())
150148
.flatten(),
151149
_ => None,
152150
})

0 commit comments

Comments
 (0)