(s: &str)
| 65 | } |
| 66 | |
| 67 | pub fn parse_bytes(s: &str) -> Result<Bytes, String> { |
| 68 | match hex::decode(s) { |
| 69 | Ok(bz) => Ok(Bytes::from(bz)), |
| 70 | Err(e) => Err(format!("error parsing raw bytes as hex: {e}")), |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | /// Parse a percentage value [0-100] |
| 75 | pub fn parse_percentage<T>(s: &str) -> Result<T, String> |
nothing calls this directly
no outgoing calls
no test coverage detected