Skip to content

Commit

Permalink
Simplificy signature using BoxStream
Browse files Browse the repository at this point in the history
  • Loading branch information
lukipuki committed Jan 23, 2024
1 parent 1943f58 commit 53d63c4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/connections/ble_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ use btleplug::api::{
WriteType,
};
use btleplug::platform::{Adapter, Manager, Peripheral};
use futures_util::Stream;
use futures_util::stream::BoxStream;
use log::error;
use std::pin::Pin;
use uuid::Uuid;

use crate::errors_internal::{BleConnectionError, Error, InternalStreamError};
Expand Down Expand Up @@ -159,9 +158,7 @@ impl BleHandler {
Self::parse_u32(data)
}

pub async fn notifications(
&self,
) -> Result<Pin<Box<dyn Stream<Item = ValueNotification> + Send>>, Error> {
pub async fn notifications(&self) -> Result<BoxStream<ValueNotification>, Error> {
self.radio
.subscribe(&self.fromnum_char)
.await
Expand Down

0 comments on commit 53d63c4

Please sign in to comment.