Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/notes/agenda_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub fn knowledge_items(records: &[CorpusRecord]) -> Vec<KnowledgeItem> {
)
})
.collect();
keyed.sort_by(|a, b| a.0.cmp(&b.0));
keyed.sort_by_key(|a| a.0);
keyed.into_iter().map(|(_, item)| item).collect()
}

Expand Down Expand Up @@ -297,7 +297,7 @@ fn merge_themes(themes: &[Theme], out: ThemesOutput) -> Vec<Theme> {
.map(|t| {
let mut members: Vec<&Theme> =
t.members.iter().filter_map(|&m| themes.get(m)).collect();
members.sort_by(|a, b| b.count.cmp(&a.count));
members.sort_by_key(|b| std::cmp::Reverse(b.count));
Theme {
count: members.iter().map(|m| m.count).sum(),
examples: members
Expand Down
9 changes: 3 additions & 6 deletions src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ async fn load_file_chunks_with_limit(
)
.await
{
for (chunk, prefetched) in chunks.iter_mut().zip(prefetched_blocks.into_iter()) {
for (chunk, prefetched) in chunks.iter_mut().zip(prefetched_blocks) {
chunk.prefetched_headers = prefetched;
}
}
Expand Down Expand Up @@ -532,7 +532,7 @@ async fn load_file_chunks_with_limit(
.await
{
whole_file_external_callers = whole_callers;
for (chunk, callers) in chunks.iter_mut().zip(chunk_callers.into_iter()) {
for (chunk, callers) in chunks.iter_mut().zip(chunk_callers) {
chunk.external_callers = callers;
}
}
Expand Down Expand Up @@ -1977,10 +1977,7 @@ fn extract_location_symbols(locations: &serde_json::Value) -> BTreeSet<(String,

fn strip_title_subsystem_prefix(title: &str) -> &str {
let mut rest = title.trim();
loop {
let Some((head, tail)) = rest.split_once(':') else {
break;
};
while let Some((head, tail)) = rest.split_once(':') {
// Keep C++/Rust `Type::method` intact.
if tail.starts_with(':') {
break;
Expand Down
5 changes: 1 addition & 4 deletions src/worker/prefetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,7 @@ pub async fn prefetch_external_definitions_for_chunks(
}

let mut outputs = Vec::with_capacity(chunk_ranges_1based.len());
for (chunk_syms, file_ranges) in per_chunk_symbols
.into_iter()
.zip(per_chunk_ranges.into_iter())
{
for (chunk_syms, file_ranges) in per_chunk_symbols.into_iter().zip(per_chunk_ranges) {
let mut range_map: LineRangeMap = BTreeMap::new();
for sym in &chunk_syms {
if let Some((def_path, start, end)) = resolved.get(sym) {
Expand Down
Loading