Remove dead code from bun_url

Closed
RO
3mo ago
+1-65

Removes unreferenced items from src/url/lib.rs that were carried over from the Zig port but have no callers anywhere in the workspace.

Removed

  • URL::is_localhost(): zero references.
  • QueryStringMap::get_index(): only called by has(), which is itself unused.
  • QueryStringMap::get(): zero references.
  • QueryStringMap::has(): zero references.
  • QueryStringMap::get_all(): only called get_all_with_hash_from_offset(), zero external references.
  • QueryStringMap::get_all_with_hash_from_offset(): only called by get_all().
  • NAME_COUNT_BUF thread-local static: already annotated as unused, for the commented-out Zig path in get_name_count.
  • QueryStringMap.name_count field: set to None at all three construction sites and cloned, never read. Part of the same never-enabled caching mechanism as NAME_COUNT_BUF.
  • use core::cell::RefCell: only used by NAME_COUNT_BUF.
  • Commented-out Zig body inside get_name_count().

Also relaxes get_name_count(&mut self) to &self since the removed caching write was the only mutation.

The only out-of-crate consumer of QueryStringMap is src/runtime/api/filesystem_router.rs, which uses init, init_with_scanner, iter, get_name_count, and str only.

Verification

  • rg for each symbol across src/, build/debug/codegen/, and src/codegen/: zero hits outside src/url/lib.rs.
  • bun bd: builds clean.
  • bun run rust:check-all: all 10 targets pass.
  • bun bd test test/js/bun/util/filesystem_router.test.ts: 29 pass, 0 fail.

Net: 1 file changed, 1 insertion, 65 deletions.