Просмотр исходного кода

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

skoupidi 1 год назад
Родитель
Сommit
4074bacb28
1 измененных файлов с 1 добавлено и 1 удалено
  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()))
         }