Compare commits
No commits in common. "e4f470837c415cf91627b0227caea81624a37cf7" and "386cf693a1450d766c3deef26c69506db39c5c02" have entirely different histories.
e4f470837c
...
386cf693a1
@ -5,9 +5,6 @@ version.workspace = true
|
|||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
[features]
|
|
||||||
testing = []
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rand = "0.9"
|
rand = "0.9"
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
|
|||||||
@ -39,14 +39,9 @@ static HARMONY_EVENT_BUS: Lazy<broadcast::Sender<HarmonyEvent>> = Lazy::new(|| {
|
|||||||
});
|
});
|
||||||
|
|
||||||
pub fn instrument(event: HarmonyEvent) -> Result<(), &'static str> {
|
pub fn instrument(event: HarmonyEvent) -> Result<(), &'static str> {
|
||||||
if cfg!(any(test, feature = "testing")) {
|
match HARMONY_EVENT_BUS.send(event) {
|
||||||
let _ = event; // Suppress the "unused variable" warning for `event`
|
Ok(_) => Ok(()),
|
||||||
Ok(())
|
Err(_) => Err("send error: no subscribers"),
|
||||||
} else {
|
|
||||||
match HARMONY_EVENT_BUS.send(event) {
|
|
||||||
Ok(_) => Ok(()),
|
|
||||||
Err(_) => Err("send error: no subscribers"),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ impl Default for K3DInstallationScore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Topology> Score<T> for K3DInstallationScore {
|
impl<T: Topology> Score<T> for K3DInstallationScore {
|
||||||
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
|
fn create_interpret(&self) -> Box<dyn crate::interpret::Interpret<T>> {
|
||||||
Box::new(K3dInstallationInterpret {
|
Box::new(K3dInstallationInterpret {
|
||||||
score: self.clone(),
|
score: self.clone(),
|
||||||
})
|
})
|
||||||
|
|||||||
@ -5,10 +5,6 @@ version.workspace = true
|
|||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
[features]
|
|
||||||
default = ["tui"]
|
|
||||||
tui = ["dep:harmony_tui"]
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
assert_cmd = "2.0.17"
|
assert_cmd = "2.0.17"
|
||||||
clap = { version = "4.5.35", features = ["derive"] }
|
clap = { version = "4.5.35", features = ["derive"] }
|
||||||
@ -23,5 +19,7 @@ lazy_static = "1.5.0"
|
|||||||
log.workspace = true
|
log.workspace = true
|
||||||
indicatif-log-bridge = "0.2.3"
|
indicatif-log-bridge = "0.2.3"
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
harmony = { path = "../harmony", features = ["testing"] }
|
[features]
|
||||||
|
default = ["tui"]
|
||||||
|
tui = ["dep:harmony_tui"]
|
||||||
|
|||||||
@ -165,7 +165,7 @@ async fn init<T: Topology + Send + Sync + 'static>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod test {
|
||||||
use harmony::{
|
use harmony::{
|
||||||
inventory::Inventory,
|
inventory::Inventory,
|
||||||
maestro::Maestro,
|
maestro::Maestro,
|
||||||
|
|||||||
@ -23,18 +23,9 @@ static HARMONY_COMPOSER_EVENT_BUS: Lazy<broadcast::Sender<HarmonyComposerEvent>>
|
|||||||
});
|
});
|
||||||
|
|
||||||
pub fn instrument(event: HarmonyComposerEvent) -> Result<(), &'static str> {
|
pub fn instrument(event: HarmonyComposerEvent) -> Result<(), &'static str> {
|
||||||
#[cfg(not(test))]
|
match HARMONY_COMPOSER_EVENT_BUS.send(event) {
|
||||||
{
|
Ok(_) => Ok(()),
|
||||||
match HARMONY_COMPOSER_EVENT_BUS.send(event) {
|
Err(_) => Err("send error: no subscribers"),
|
||||||
Ok(_) => Ok(()),
|
|
||||||
Err(_) => Err("send error: no subscribers"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
{
|
|
||||||
let _ = event; // Suppress the "unused variable" warning for `event`
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user