Przeglądaj źródła

zkas/decoder: (clippy chore) replace as_bytes().len() with len() since it returns the bytes length on strings

skoupidi 1 rok temu
rodzic
commit
4074bacb28
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/zkas/decoder.rs

+ 1 - 1
src/zkas/decoder.rs

@@ -69,7 +69,7 @@ impl ZkBinary {
         let (namespace, _): (String, _) = deserialize_partial(&bytes[9..])?;
 
         // Enforce a limit on the namespace string length
-        if namespace.as_bytes().len() > MAX_NS_LEN {
+        if namespace.len() > MAX_NS_LEN {
             return Err(ZkasErr("Namespace too long".to_string()))
         }