mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-03-19 20:14:17 -04:00
`slices::Slices::get_range` was too closely following the example of `http_serve::Entity::get_range`: The latter is once-per-request, so just boxing is low-cost and makes sense to easily avoid monomorphization bloat when there are potentially many types of entity streams in one program. In Moonfire, it's used with different streams defined in the `moonfire_nvr::web::mp4`, `moonfire_nvr::bundled_ui`, and `http_serve::file` modules. Putting them all into a single boxless enum would be a pain. In particular, the last one is not a nameable type today and would need more generic parameters to implement the caller-demanded `Entity` definition. The former is once-per-slice, there are tons of slices per request, and it's easy to define a two-case enum right where it's needed. So the trade-off is quite different. Also fix up some out-of-date comments.