Closed liamwh closed 1 week ago
@liamwh Ho yes, good one. I am going to fix that. It should not be Box<dyn...
, it was a left over from before.
Good timing, I was going to do the 0.1.8 release.
Doing the commit now.
@liamwh Just pushed it. I am going to do the release today or tomorrow.
Super fast, awesome stuff, thanks very much 🙏! I dropped another issue here btw that might be good for the next release also?
@liamwh release made.
I'm on mobile so please forgive the lack of formatting or examples, however I was getting issues with the error type from
print_chat_stream
beingBox<dyn std::Error
. Due to the fact thatBox
is used, the size of the error can not be known at compile time, meaning that the result ofprint_chat_stream
is no longerSend + Sync
, limiting its usage considerably. For example, I'd like to be able to useanyhow
'sContext
trait on the result ofprint_chat_stream
and propoagate it up the call stack using anyhow's Result type, but I believe that requires the error to be Send + Senc, though as I said I'm on mobile and not 100% certain there.I'm not sure of the best practice solution here but I do know that most libraries use
thiserror
to which resolves this problem.Would you please remove the Box from the error returned from
print_chat_stream
and perhaps anywhere else Box is used for errors?