also some tests would be nice, especially for cases with empty segments:
\x00test\x00
should beAuthBody { login: "test", password: "" }
\x00\x00
should be `AuthBody { login: "",…
each unwrap()
crashes the thread completely which is not very desirable. instead it's better to return an Err
from the method
fine for now, but this fails the stream, and instead we should send a proper XML error to the client
I don't think you need that clone here, you can just make the function argument mutable
not sure about the algorithm, afaik there could be three different segments: <authzid>\x00<authcid>\x00<passwd>
, the first one could be empty and we don't really use it (for now? not sure), but it's better not to skip empty ones and just ignore them
you can just compare them directly without taking references and without specifying the numeric type (it will be inferred automatically)
if separated_words.len() == 2