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:
@@ -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() })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user