fix(review): as dependency using wrong binary

The order of Backend::{get_binary,get_binary_inner} was wrong.
The binary was actually never overwritten.
This commit is contained in:
steven-omaha
2023-03-03 17:32:34 +01:00
parent e511235717
commit 83865e21e9
3 changed files with 5 additions and 5 deletions
@@ -28,7 +28,7 @@ const SUPPORTS_AS_DEPENDENCY: bool = true;
impl Backend for Arch { impl Backend for Arch {
impl_backend_constants!(); impl_backend_constants!();
fn get_binary_inner(&self) -> Text { fn get_binary(&self) -> Text {
let r#box = self.binary.clone().into_boxed_str(); let r#box = self.binary.clone().into_boxed_str();
Box::leak(r#box) Box::leak(r#box)
} }
@@ -12,10 +12,10 @@ pub(in crate::backend) type Switches = &'static [&'static str];
pub(in crate::backend) type Text = &'static str; pub(in crate::backend) type Text = &'static str;
pub trait Backend: Debug { pub trait Backend: Debug {
fn get_binary(&self) -> Text; fn get_binary(&self) -> Text {
fn get_binary_inner(&self) -> Text { self.get_binary_default()
self.get_binary()
} }
fn get_binary_default(&self) -> Text;
fn get_section(&self) -> Text; fn get_section(&self) -> Text;
fn get_switches_info(&self) -> Switches; fn get_switches_info(&self) -> Switches;
+1 -1
View File
@@ -3,7 +3,7 @@
#[macro_export] #[macro_export]
macro_rules! impl_backend_constants { macro_rules! impl_backend_constants {
() => { () => {
fn get_binary(&self) -> Text { fn get_binary_default(&self) -> Text {
BINARY BINARY
} }