Open KilroyWasHere-cs-j opened 1 year ago
I got the same error when a user was sending non-unicode characters and I tried to stringify, solution in my case was to use from_utf8_lossy (which obviously will lose some information though).
String::from_utf8_lossy(&topic).to_string();
I think this issue can be closed now: @magnificus responded to the problem @KilroyWasHere-cs-j was dealing with, and the problem was just that data[1]
wasn't valid UTF-8, which is not an issue with rust-zmq.
Yep correct. No need to leave this open.
str::from_utf8(&data[1]).unwrap() throws
Result::unwrap()
on anErr
value: Utf8Error { valid_up_to: 0, error_len: Some(1) }New to rust what's the fix.