-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
We call num.to_string().as_bytes() to serialize and deserialize numbers when setting them in memcache server. Instead, we could use byteorder crate's read_u16, read_u64 etc. and write out the bytes to the server with a specific endianness(big/little) and use the same when deserializing.
deserialization:
Line 161 in faed4e1
| let s: String = FromMemcacheValue::from_memcache_value(value, 0)?; |
serialization:
Line 95 in faed4e1
| match stream.write_all(self.to_string().as_bytes()) { |
Line 91 in faed4e1
| return self.to_string().as_bytes().len(); |