cleanup: strip comments, extract constants, DRY shared helpers across adapters + infra-wiring
- strip all comments except WHY workaround notes (3 remain) - remove all #[allow(dead_code)]; fix via _prefix rename - extract named constants: JWT time units, token types, default config values, jellyfin fallback bitrate - DRY: move serialize_enum_as_string, content_type_str, parse_content_type, parse_genres_blob to adapter-common - sqlite+postgres library.rs use shared helpers instead of local copies - sqlite+postgres channel.rs use shared serialize_enum_as_string - remove dead `let _ = ext` in scanner.rs
This commit is contained in:
@@ -26,7 +26,7 @@ impl ChannelEventBus {
|
||||
#[async_trait]
|
||||
impl EventPublisher for ChannelEventBus {
|
||||
async fn publish(&self, event: DomainEvent) -> DomainResult<()> {
|
||||
let _ = self.tx.send(event); // Ok to drop if no receivers
|
||||
let _ = self.tx.send(event);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -34,9 +34,6 @@ impl EventPublisher for ChannelEventBus {
|
||||
#[async_trait]
|
||||
impl EventConsumer for ChannelEventBus {
|
||||
async fn recv(&self) -> DomainResult<DomainEvent> {
|
||||
// Note: This creates a new subscriber each call — for real use,
|
||||
// the presentation layer should hold a receiver from subscriber()
|
||||
// This impl exists to satisfy the port trait
|
||||
let mut rx = self.tx.subscribe();
|
||||
rx.recv()
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user