Skip to content

Commit

Permalink
Merge pull request #1546 from nyurik/semilocons
Browse files Browse the repository at this point in the history
Add missing semicolons
  • Loading branch information
Byron authored Aug 24, 2024
2 parents 7df1d03 + ec69c88 commit f992fb7
Show file tree
Hide file tree
Showing 170 changed files with 296 additions and 296 deletions.
2 changes: 1 addition & 1 deletion examples/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fn run(args: Args) -> anyhow::Result<()> {
if args.reverse {
let mut results: Vec<_> = log_iter.collect();
results.reverse();
log_iter = Box::new(results.into_iter())
log_iter = Box::new(results.into_iter());
}

let mut log_iter = log_iter
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/corpus/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl Engine {
}
repo_progress.info(format!("with {} tasks", tasks.len()));
for (_, task) in tasks {
repo_progress.info(format!("task '{}' ({})", task.description, task.short_name))
repo_progress.info(format!("task '{}' ({})", task.description, task.short_name));
}
break 'tasks_loop;
}
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/corpus/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl Task {
) {
let start = std::time::Instant::now();
if let Err(err) = self.execute.execute(repo, progress, threads, should_interrupt) {
run.error = Some(format!("{err:#?}"))
run.error = Some(format!("{err:#?}"));
}
run.duration = start.elapsed();
}
Expand Down
4 changes: 2 additions & 2 deletions gitoxide-core/src/hours/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ pub fn estimate_hours(
for next in commits {
let change_in_minutes = (next.time.seconds.saturating_sub(cur.time.seconds)) as f32 / MINUTES_PER_HOUR;
if change_in_minutes < MAX_COMMIT_DIFFERENCE_IN_MINUTES {
hours += change_in_minutes / MINUTES_PER_HOUR
hours += change_in_minutes / MINUTES_PER_HOUR;
} else {
hours += FIRST_COMMIT_ADDITION_IN_MINUTES / MINUTES_PER_HOUR
hours += FIRST_COMMIT_ADDITION_IN_MINUTES / MINUTES_PER_HOUR;
}
cur = next;
}
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/hours/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ where
.send(std::mem::replace(&mut chunk, Vec::with_capacity(CHUNK_SIZE)))
.ok();
} else {
chunk.push((commit_idx, first_parent, commit))
chunk.push((commit_idx, first_parent, commit));
}
}
commit_idx += 1;
Expand Down
4 changes: 2 additions & 2 deletions gitoxide-core/src/index/information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ mod serde_only {
names.push("fs-monitor (FSMN)");
};
if f.had_offset_table() {
names.push("offset-table (IEOT)")
names.push("offset-table (IEOT)");
}
if f.had_end_of_index_marker() {
names.push("end-of-index (EOIE)")
names.push("end-of-index (EOIE)");
}
Extensions { names, tree }
},
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/pack/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ where
pack::data::output::bytes::FromEntriesIter::new(
in_order_entries.by_ref().inspect(|e| {
if let Ok(entries) = e {
entries_progress.inc_by(entries.len())
entries_progress.inc_by(entries.len());
}
}),
&mut pack_file,
Expand Down
4 changes: 2 additions & 2 deletions gitoxide-core/src/pack/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<W> protocol::fetch::DelegateBlocking for CloneDelegate<W> {
}
} else {
for r in &self.wanted_refs {
arguments.want_ref(r.as_ref())
arguments.want_ref(r.as_ref());
}
}
Ok(Action::Cancel)
Expand Down Expand Up @@ -408,7 +408,7 @@ fn receive_pack_blocking<W: io::Write>(
OutputFormat::Human => drop(print(&mut ctx.out, outcome, refs)),
#[cfg(feature = "serde")]
OutputFormat::Json => {
serde_json::to_writer_pretty(&mut ctx.out, &JsonOutcome::from_outcome_and_refs(outcome, refs))?
serde_json::to_writer_pretty(&mut ctx.out, &JsonOutcome::from_outcome_and_refs(outcome, refs))?;
}
};
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions gitoxide-core/src/query/engine/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ pub fn update(
out_chunk.push(CommitDiffStats {
id: commit,
changes: Vec::new(),
})
});
}
}
if tx_stats.send(Ok((chunk_id, out_chunk))).is_err() {
Expand Down Expand Up @@ -500,7 +500,7 @@ fn remove_lines(out: &mut Vec<FileChange>, path: &BStr, lines_counter: &AtomicUs
mode: FileMode::Removed,
source_relpath: None,
lines: Some(lines),
})
});
}
}

Expand Down
4 changes: 2 additions & 2 deletions gitoxide-core/src/repository/attributes/validate_baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ pub(crate) mod function {
actual: matches.iter().map(|m| m.assignment.to_owned()).collect(),
expected,
},
))
));
}
}
}
Expand All @@ -228,7 +228,7 @@ pub(crate) mod function {
actual: match_.map(Into::into),
expected: location,
},
))
));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/index/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub(crate) mod function {
to_human_simple(out, &index, entry, attrs, prefix)
} else {
to_human(out, &index, entry, attrs, prefix)
}?
}?;
}
#[cfg(feature = "serde")]
OutputFormat::Json => to_json(out, &index, entry, attrs, entries.peek().is_none(), prefix)?,
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn from_list(
gix::index::entry::Flags::empty(),
gix::index::entry::Mode::FILE,
gix::path::to_unix_separators_on_windows(path).as_ref(),
)
);
}
index.sort_entries();

Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/odb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub fn statistics(
match item {
find::Header::Loose { size, kind } => {
self.loose_objects += 1;
self.count(kind, size)
self.count(kind, size);
}
find::Header::Packed(packed) => {
self.packed_objects += 1;
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/revision/explain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl<'a> delegate::Kind for Explain<'a> {
impl<'a> Delegate for Explain<'a> {
fn done(&mut self) {
if !self.has_implicit_anchor && self.ref_name.is_none() && self.oid_prefix.is_none() {
self.err = Some("Incomplete specification lacks its anchor, like a reference or object name".into())
self.err = Some("Incomplete specification lacks its anchor, like a reference or object name".into());
}
}
}
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mod entries {
}

fn pop_path_component(&mut self) {
self.pop_element()
self.pop_element();
}

fn visit_tree(&mut self, _entry: &EntryRef<'_>) -> Action {
Expand Down
4 changes: 2 additions & 2 deletions gix-attributes/src/search/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Search {
let last = self.patterns.last_mut().expect("just added");
if !allow_macros {
last.patterns
.retain(|p| !matches!(p.value, Value::MacroAssignments { .. }))
.retain(|p| !matches!(p.value, Value::MacroAssignments { .. }));
}
collection.update_from_list(last);
}
Expand All @@ -84,7 +84,7 @@ impl Search {
let last = self.patterns.last_mut().expect("just added");
if !allow_macros {
last.patterns
.retain(|p| !matches!(p.value, Value::MacroAssignments { .. }))
.retain(|p| !matches!(p.value, Value::MacroAssignments { .. }));
}
collection.update_from_list(last);
}
Expand Down
6 changes: 3 additions & 3 deletions gix-attributes/src/search/outcome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ impl Outcome {
for (order, macro_attributes) in collection.iter().filter_map(|(_, meta)| {
(!meta.macro_attributes.is_empty()).then_some((meta.id.0, &meta.macro_attributes))
}) {
self.matches_by_id[order].macro_attributes.clone_from(macro_attributes)
self.matches_by_id[order].macro_attributes.clone_from(macro_attributes);
}

for (name, id) in self.selected.iter_mut().filter(|(_, id)| id.is_none()) {
*id = collection.name_to_meta.get(name.as_str()).map(|meta| meta.id)
*id = collection.name_to_meta.get(name.as_str()).map(|meta| meta.id);
}
}
self.reset();
Expand All @@ -46,7 +46,7 @@ impl Outcome {
collection: &MetadataCollection,
attribute_names: impl IntoIterator<Item = impl Into<KStringRef<'a>>>,
) {
self.initialize_with_selection_inner(collection, &mut attribute_names.into_iter().map(Into::into))
self.initialize_with_selection_inner(collection, &mut attribute_names.into_iter().map(Into::into));
}

fn initialize_with_selection_inner(
Expand Down
2 changes: 1 addition & 1 deletion gix-attributes/tests/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ fn size_of_outcome() {
std::mem::size_of::<Outcome>(),
840,
"it's quite big, shouldn't change without us noticing"
)
);
}

fn by_name(assignments: Vec<AssignmentRef>) -> BTreeMap<NameRef, StateRef> {
Expand Down
2 changes: 1 addition & 1 deletion gix-bitmap/src/ewah.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn decode(data: &[u8]) -> Result<(Vec, &[u8]), decode::Error> {
for _ in 0..len {
let (bit_num, rest) = bits.split_at(std::mem::size_of::<u64>());
bits = rest;
buf.push(u64::from_be_bytes(bit_num.try_into().unwrap()))
buf.push(u64::from_be_bytes(bit_num.try_into().unwrap()));
}

let (rlw, data) = decode::u32(data).ok_or(Error::Corrupt {
Expand Down
2 changes: 1 addition & 1 deletion gix-chunk/src/file/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl file::Index {
start: offset,
end: next_offset,
},
})
});
}

let sentinel = to_kind(&toc_entry[..4]);
Expand Down
4 changes: 2 additions & 2 deletions gix-chunk/src/file/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ mod write_chunk {
entry.offset.end,
self.written_bytes,
std::str::from_utf8(&entry.kind)
)
);
}
self.written_bytes = 0;
self.next_chunk = self.chunks_to_write.pop_front();
Expand Down Expand Up @@ -92,7 +92,7 @@ impl Index {
self.chunks.push(Entry {
kind: chunk,
offset: 0..exact_size_on_disk,
})
});
}

/// Return the total size of all planned chunks thus far.
Expand Down
4 changes: 2 additions & 2 deletions gix-config-value/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl Display for Color {
write!(f, " ")?;
}
bg.fmt(f)?;
write_space = Some(())
write_space = Some(());
}

if !self.attributes.is_empty() {
Expand Down Expand Up @@ -267,7 +267,7 @@ impl Display for Attribute {
};
if self.contains(attr) {
if write_space.take().is_some() {
write!(f, " ")?
write!(f, " ")?;
}
match attr {
Attribute::RESET => write!(f, "reset"),
Expand Down
4 changes: 2 additions & 2 deletions gix-config/benches/large_config_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use gix_config::{parse::Events, File};

fn gix_config(c: &mut Criterion) {
c.bench_function("GitConfig large config file", |b| {
b.iter(|| File::try_from(black_box(CONFIG_FILE)).unwrap())
b.iter(|| File::try_from(black_box(CONFIG_FILE)).unwrap());
});
}

fn parser(c: &mut Criterion) {
c.bench_function("Parser large config file", |b| {
b.iter(|| Events::try_from(black_box(CONFIG_FILE)).unwrap())
b.iter(|| Events::try_from(black_box(CONFIG_FILE)).unwrap());
});
}

Expand Down
2 changes: 1 addition & 1 deletion gix-config/src/file/access/mutate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ impl<'event> File<'event> {
if !ends_with_newline(lhs.as_ref(), nl, true)
&& !rhs.first().map_or(true, |e| e.to_bstr_lossy().starts_with(nl.as_ref()))
{
lhs.push(Event::Newline(Cow::Owned(nl.as_ref().into())))
lhs.push(Event::Newline(Cow::Owned(nl.as_ref().into())));
}
lhs.extend(rhs);
}
Expand Down
8 changes: 4 additions & 4 deletions gix-config/src/file/includes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ fn resolve_includes_recursive(
let header = &section.header;
let header_name = header.name.as_ref();
if header_name == "include" && header.subsection_name.is_none() {
detach_include_paths(&mut section_ids_and_include_paths, section, id)
detach_include_paths(&mut section_ids_and_include_paths, section, id);
} else if header_name == "includeIf" {
if let Some(condition) = &header.subsection_name {
let target_config_path = section.meta.path.as_deref();
if include_condition_match(condition.as_ref(), target_config_path, options.includes)? {
detach_include_paths(&mut section_ids_and_include_paths, section, id)
detach_include_paths(&mut section_ids_and_include_paths, section, id);
}
}
}
Expand Down Expand Up @@ -142,7 +142,7 @@ fn detach_include_paths(
.values("path")
.into_iter()
.map(|path| (id, crate::Path::from(Cow::Owned(path.into_owned())))),
)
);
}

fn include_condition_match(
Expand Down Expand Up @@ -251,7 +251,7 @@ fn gitdir_matches(
{
let mut prefixed = pattern_path.into_owned();
prefixed.insert_str(0, "**/");
pattern_path = prefixed.into()
pattern_path = prefixed.into();
}
if pattern_path.ends_with(b"/") {
let mut suffixed = pattern_path.into_owned();
Expand Down
4 changes: 2 additions & 2 deletions gix-config/src/file/section/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ impl<'event> Body<'event> {
}
Event::ValueNotDone(_) | Event::ValueDone(_) => {
if value_range.end == 0 {
value_range.end = i
value_range.end = i;
} else {
value_range.start = i
value_range.start = i;
};
}
_ => (),
Expand Down
2 changes: 1 addition & 1 deletion gix-config/src/parse/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ fn from_bytes<'a, 'b>(
}
event => {
if filter.map_or(true, |f| f(&event)) {
events.push(convert(event))
events.push(convert(event));
}
}
})?;
Expand Down
2 changes: 1 addition & 1 deletion gix-config/tests/key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn valid_and_invalid() {
assert_eq!(key.value_name, "baz");

let key = "includeIf.gitdir/i:C:\\bare.git.path".as_key();
assert_eq!(key.subsection_name, Some("gitdir/i:C:\\bare.git".into()),)
assert_eq!(key.subsection_name, Some("gitdir/i:C:\\bare.git".into()),);
}

mod _ref {
Expand Down
2 changes: 1 addition & 1 deletion gix-config/tests/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn newlines_with_spaces() {
assert_eq!(
Events::from_str("\n \n \n").unwrap().into_vec(),
vec![newline(), whitespace(" "), newline(), whitespace(" "), newline()]
)
);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion gix-credentials/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct Context {
pub fn helper_outcome_to_result(outcome: Option<helper::Outcome>, action: helper::Action) -> Result {
fn redact(mut ctx: Context) -> Context {
if let Some(pw) = ctx.password.as_mut() {
*pw = "<redacted>".into()
*pw = "<redacted>".into();
}
ctx
}
Expand Down
Loading

0 comments on commit f992fb7

Please sign in to comment.