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
156 .and_then(|_| committer.write_to(&mut file))156 .and_then(|_| committer.write_to(&mut file))
157 .and_then(|_| {157 .and_then(|_| {
158 if !message.is_empty() {158 if !message.is_empty() {
159 writeln!(file, "\t{}", message)159 writeln!(file, "\t{message}")
160 } else {160 } else {
161 writeln!(file)161 writeln!(file)
162 }162 }
git-ref/src/store/file/transaction/prepare.rs+1−1
@@ -183,7 +183,7 @@ impl<'s, 'p> Transaction<'s, 'p> { · 182 unmodified lines
183 let mut lock = lock.take().map(Ok).unwrap_or_else(obtain_lock)?;183 let mut lock = lock.take().map(Ok).unwrap_or_else(obtain_lock)?;
184 184
185 lock.with_mut(|file| match new {185 lock.with_mut(|file| match new {
186 Target::Peeled(oid) => write!(file, "{}", oid),186 Target::Peeled(oid) => write!(file, "{oid}"),
187 Target::Symbolic(name) => write!(file, "ref: {}", name.0),187 Target::Symbolic(name) => write!(file, "ref: {}", name.0),
188 })?;188 })?;
189 Some(lock.close()?)189 Some(lock.close()?)
git-ref/src/store/packed/transaction.rs+5−5
@@ -81,7 +81,7 @@ impl packed::Transaction { · 80 unmodified lines
81 Some(kind) if kind == git_object::Kind::Tag => {81 Some(kind) if kind == git_object::Kind::Tag => {
82 next_id = git_object::TagRefIter::from_bytes(&buf).target_id().map_err(|_| {82 next_id = git_object::TagRefIter::from_bytes(&buf).target_id().map_err(|_| {
83 prepare::Error::Resolve(83 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(),
85 )85 )
86 })?;86 })?;
87 }87 }
@@ -90,7 +90,7 @@ impl packed::Transaction { · 2 unmodified lines
90 }90 }
91 None => {91 None => {
92 return Err(prepare::Error::Resolve(92 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(),
94 ))94 ))
95 }95 }
96 }96 }
@@ -194,7 +194,7 @@ fn write_packed_ref(mut out: impl std::io::Write, pref: packed::Reference<'_>) - · 97 unmodified lines
194 out.write_all(pref.name.as_bstr())?;194 out.write_all(pref.name.as_bstr())?;
195 out.write_all(b"\n")?;195 out.write_all(b"\n")?;
196 if let Some(object) = pref.object {196 if let Some(object) = pref.object {
197 writeln!(out, "^{}", object)?;197 writeln!(out, "^{object}")?;
198 }198 }
199 Ok(())199 Ok(())
200}200}
@@ -206,11 +206,11 @@ fn write_edit(mut out: impl std::io::Write, edit: &Edit, lines_written: &mut i32 · 5 unmodified lines
206 new: Target::Peeled(target_oid),206 new: Target::Peeled(target_oid),
207 ..207 ..
208 } => {208 } => {
209 write!(out, "{} ", target_oid)?;209 write!(out, "{target_oid} ")?;
210 out.write_all(edit.inner.name.as_bstr())?;210 out.write_all(edit.inner.name.as_bstr())?;
211 out.write_all(b"\n")?;211 out.write_all(b"\n")?;
212 if let Some(object) = edit.peeled {212 if let Some(object) = edit.peeled {
213 writeln!(out, "^{}", object)?;213 writeln!(out, "^{object}")?;
214 }214 }
215 *lines_written += 1;215 *lines_written += 1;
216 }216 }
git-ref/src/transaction/ext.rs+2−5
@@ -34,7 +34,7 @@ where · 33 unmodified lines
34 self.assure_one_name_has_one_edit().map_err(|name| {34 self.assure_one_name_has_one_edit().map_err(|name| {
35 std::io::Error::new(35 std::io::Error::new(
36 std::io::ErrorKind::AlreadyExists,36 std::io::ErrorKind::AlreadyExists,
37 format!("A reference named '{}' has multiple edits", name),37 format!("A reference named '{name}' has multiple edits"),
38 )38 )
39 })39 })
40 }40 }
@@ -121,10 +121,7 @@ where · 80 unmodified lines
121 if round == 5 {121 if round == 5 {
122 break Err(std::io::Error::new(122 break Err(std::io::Error::new(
123 std::io::ErrorKind::WouldBlock,123 std::io::ErrorKind::WouldBlock,
124 format!(124 format!("Could not follow all splits after {round} rounds, assuming reference cycle"),
125 "Could not follow all splits after {} rounds, assuming reference cycle",
126 round
127 ),
128 ));125 ));
129 }126 }
130 round += 1;127 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