This commit is contained in:
Andras Schmelczer 2025-03-15 17:13:11 +00:00
parent 826e391f87
commit aad93fef84
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
3 changed files with 6 additions and 2 deletions

View file

@ -66,7 +66,7 @@ pub fn merge_text(parent: &str, left: &str, right: &str) -> String {
pub fn is_binary(data: &[u8]) -> bool {
set_panic_hook();
if data.iter().any(|&b| b == 0) {
if data.contains(&0) {
// Even though the NUL character is valid in UTF-8, it's highly suspicious in
// human-readable text.
return true;