Skip to content

Commit 309dc76

Browse files
feat: add ASCII check before appending string to hex display (#376)
* feat: add ASCII check before appending string to hex display * fix
1 parent 68e8bd7 commit 309dc76

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

grovedb/src/reference_path.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,11 @@ fn display_path(path: &[Vec<u8>]) -> String {
147147
.map(|bytes| {
148148
let mut hx = hex::encode(bytes);
149149
if let Ok(s) = String::from_utf8(bytes.clone()) {
150-
hx.push('(');
151-
hx.push_str(&s);
152-
hx.push(')');
150+
if s.chars().all(|c| c.is_ascii_alphanumeric() || c == '_') {
151+
hx.push('(');
152+
hx.push_str(&s);
153+
hx.push(')');
154+
}
153155
}
154156

155157
hx

0 commit comments

Comments
 (0)