Closed eivindbergem closed 2 months ago
I changed Runner so that buffer is not owned, but instead is an argument to input_byte.
I think this means the user of the crate is now free to fiddle with the contents of the buffer (even adding non-UTF-8 bytes). What prompted the change?
I changed Runner so that buffer is not owned, but instead is an argument to input_byte.
I think this means the user of the crate is now free to fiddle with the contents of the buffer (even adding non-UTF-8 bytes). What prompted the change?
Editor
already owns it own buffer, so it was the shortest path to get something working. A possible solution is to make Runner
generic over the buffer and have to concrete implementations with &mut [u8]
and Editor
.
Hmm. We might need a trait or something to abstract across either a raw buffer or an Editor. Or we can create some BasicEditor functionality which does what the crate currently does.
I've made Runner
generic over buffer
, allowing either anything that implements AsMut<[u8]>
, or Editor
, depending on which constructor is used. No traits needed.
I've also added support for the dynamic prompt in noline. I've pointed the noline crate to the branch for the prompt support for now. I'll make a new release of noline
when this is ready.
I had to move the MenuManager
to an InnerRunner
to avoid Lifetime issues with the prompt, and pass interface
as an argument to all the methods. I guess all the methods from InnerRunner
could be moved into MenuManager
itself, but I'll let you decide on how that is best solved.
This looks OK to me. Thank you!
As you've re-written the prompt handling, would you mind looking at https://github.com/rust-embedded-community/menu/issues/25? I spotted this whilst testing.
Thank you. Whilst testing I spotted that clippy was warning about unused imports - we now check clippy in CI in https://github.com/rust-embedded-community/menu/pull/26.
Would you mind rebasing and looking at the clippy output?
Ok, now I've fixed everything, I hope :)
Thank you!
I've done a quick implementation and got something working. There are some remaining issues that need to be figured out:
Display
. That would work with blocking IO, but since we don't havewrite_fmt
forembedded_io_async::Write
it would break async support innoline
.embedded_io
as dependency and usedWrite
from there instead ofcore::fmt::Write
.Runner
so thatbuffer
is not owned, but instead is an argument toinput_byte
.23