From 1ed0de3fa434cd7cf9b709ffd13574037de2a656 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 18 Sep 2025 14:31:26 +0000 Subject: [PATCH] why that code is like that --- src/poll.rs | 15 +++++++++++++++ 1 file(s) changed, 15 insertion(s)(+), 0 deletion(s)(-) diff --git a/src/poll.rs b/src/poll.rs --- a/src/poll.rs +++ b/src/poll.rs @@ -48,6 +48,21 @@ keys_at: Vec, // expected to ~always be length one } +// ok so this is silly. +// +// i think i had some idea that deferring parsing to later steps would make it +// easier to do things like sometimes not parsing at all (where the output is +// also json lines), and maybe avoid some memory shuffling. +// but since the input already has to be split into lines, keeping them as line +// strings is probably the worst option: space-inefficient, allows garbage, and +// leads to, well, this impl. +// +// it almost could have been slick if the *original* was just reused, and the +// parsed ops were just kind of on the side referencing into it, but i'm lazy +// and didn't get it there. +// +// should unrefactor to make Op own its data again, parse (and deal with errors) +// upfront, and probably greatly simplify everything downstream. simple. impl PageBoundaryState { fn new(page: &mut ExportPage) -> Option { // grab the very last op -- tangled.sh