History

thanks clippy

Sebastian Thiel committed 3 years ago

Commit bac57dd1 parent e22080e100 files · +172 −230Browse files

Showing the changes to git-ref/src (4 of 100 files). Show all

Unified · Split

4 files
  1. git-ref/src/store/file/loose/reflog.rs +1 −1
  2. git-ref/src/store/file/transaction/prepare.rs +1 −1
  3. git-ref/src/store/packed/transaction.rs +5 −5
  4. git-ref/src/transaction/ext.rs +2 −5
git-ref/src/store/file/loose/reflog.rs+1−1
@@ -156,7 +156,7 @@ pub mod create_or_update { · 155 unmodified lines
156156 .and_then(|_| committer.write_to(&mut file))
157157 .and_then(|_| {
158158 if !message.is_empty() {
159− writeln!(file, "\t{}", message)
159+ writeln!(file, "\t{message}")
160160 } else {
161161 writeln!(file)
162162 }
git-ref/src/store/file/transaction/prepare.rs+1−1
@@ -183,7 +183,7 @@ impl<'s, 'p> Transaction<'s, 'p> { · 182 unmodified lines
183183 let mut lock = lock.take().map(Ok).unwrap_or_else(obtain_lock)?;
184184
185185 lock.with_mut(|file| match new {
186− Target::Peeled(oid) => write!(file, "{}", oid),
186+ Target::Peeled(oid) => write!(file, "{oid}"),
187187 Target::Symbolic(name) => write!(file, "ref: {}", name.0),
188188 })?;
189189 Some(lock.close()?)
git-ref/src/store/packed/transaction.rs+5−5
@@ -81,7 +81,7 @@ impl packed::Transaction { · 80 unmodified lines
8181 Some(kind) if kind == git_object::Kind::Tag => {
8282 next_id = git_object::TagRefIter::from_bytes(&buf).target_id().map_err(|_| {
8383 prepare::Error::Resolve(
84− format!("Couldn't get target object id from tag {}", next_id).into(),
84+ format!("Couldn't get target object id from tag {next_id}").into(),
8585 )
8686 })?;
8787 }
@@ -90,7 +90,7 @@ impl packed::Transaction { · 2 unmodified lines
9090 }
9191 None => {
9292 return Err(prepare::Error::Resolve(
93− format!("Couldn't find object with id {}", next_id).into(),
93+ format!("Couldn't find object with id {next_id}").into(),
9494 ))
9595 }
9696 }
@@ -194,7 +194,7 @@ fn write_packed_ref(mut out: impl std::io::Write, pref: packed::Reference<'_>) - · 97 unmodified lines
194194 out.write_all(pref.name.as_bstr())?;
195195 out.write_all(b"\n")?;
196196 if let Some(object) = pref.object {
197− writeln!(out, "^{}", object)?;
197+ writeln!(out, "^{object}")?;
198198 }
199199 Ok(())
200200 }
@@ -206,11 +206,11 @@ fn write_edit(mut out: impl std::io::Write, edit: &Edit, lines_written: &mut i32 · 5 unmodified lines
206206 new: Target::Peeled(target_oid),
207207 ..
208208 } => {
209− write!(out, "{} ", target_oid)?;
209+ write!(out, "{target_oid} ")?;
210210 out.write_all(edit.inner.name.as_bstr())?;
211211 out.write_all(b"\n")?;
212212 if let Some(object) = edit.peeled {
213− writeln!(out, "^{}", object)?;
213+ writeln!(out, "^{object}")?;
214214 }
215215 *lines_written += 1;
216216 }
git-ref/src/transaction/ext.rs+2−5
@@ -34,7 +34,7 @@ where · 33 unmodified lines
3434 self.assure_one_name_has_one_edit().map_err(|name| {
3535 std::io::Error::new(
3636 std::io::ErrorKind::AlreadyExists,
37− format!("A reference named '{}' has multiple edits", name),
37+ format!("A reference named '{name}' has multiple edits"),
3838 )
3939 })
4040 }
@@ -121,10 +121,7 @@ where · 80 unmodified lines
121121 if round == 5 {
122122 break Err(std::io::Error::new(
123123 std::io::ErrorKind::WouldBlock,
124− format!(
125− "Could not follow all splits after {} rounds, assuming reference cycle",
126− round
127− ),
124+ format!("Could not follow all splits after {round} rounds, assuming reference cycle"),
128125 ));
129126 }
130127 round += 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t