Hobbyist here- I know I'll probably need to post some code, but am at work and hoping the issue is something obvious(it seems like it could beone of those)-
So I have a multi threaded server that is using a combination of unix sockets and channels to communicate-
-a thread grabs some input from the user in the console
sends it to the main thread (first via a channel and then via the socket)
input is used to look up the value by key.
HashMap is made like this
HashMap<"value.to_string()", svc>
//Bytes looked up like this
Let a= String:from_utf8<input.to_vec()>
map.get(a);
The issue is even though the values match by println! and the key is definitely in there, I never get a match! I was thinking it could be something to do with whatever protection they have on the HashMap but am unsure.
a must match the key exactly, it is not sufficient if the input data you use for the lookup only contains the key you are trying to access.
It might be helpful to print a using String's Debug implementation to see if it really matches the desired key as Debug formatting escapes special characters.
Thanks for the response! I am stripping off new lines in the console but I see that it's possible the buffwriter or reader could be re adding them (hopefully)! I was so tired last night I totally forgot about debug it's been so long since I had to use it!