both add_item_to_search_index in formats/cache.rs and build_index in html/render/search_index.rs construct this type. Both functions have a decent bit of logic that is unique to them, but they also have a fair bit of logic that is the same for both.
I think moving this shared logic into an associated function on IndexItem would make the code easier to maintain.
both
add_item_to_search_indexinformats/cache.rsandbuild_indexinhtml/render/search_index.rsconstruct this type. Both functions have a decent bit of logic that is unique to them, but they also have a fair bit of logic that is the same for both.I think moving this shared logic into an associated function on
IndexItemwould make the code easier to maintain.