refactor: move binary detection to common module and enhance get logic

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-11 14:18:53 -03:00
parent 6f27530b3b
commit 86dabbdbc0
3 changed files with 255 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ use std::env;
use std::process;
use uzers::{get_current_uid, get_current_gid, get_current_username, get_current_groupname};
use crate::common::is_binary;
use crate::meta_plugin::MetaPlugin;
#[derive(Debug, Clone, Default)]
@@ -258,7 +259,7 @@ impl MetaPlugin for BinaryMetaPlugin {
}
fn finalize(&mut self) -> io::Result<String> {
let is_binary = Self::is_binary(&self.buffer);
let is_binary = is_binary(&self.buffer);
Ok(if is_binary { "true".to_string() } else { "false".to_string() })
}