Skip to content

Commit

Permalink
remove lifetime arg
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Jul 18, 2024
1 parent fe7afe9 commit 9ee2343
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion geomedea-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl HttpReader {

struct FeatureCollection(geojson::FeatureCollection);
impl FeatureCollection {
async fn new(mut feature_stream: FeatureStream<'_>) -> geomedea::Result<Self> {
async fn new(mut feature_stream: FeatureStream) -> geomedea::Result<Self> {
let mut geojson_feature_collection = geojson::FeatureCollection {
bbox: None,
features: vec![],
Expand Down
14 changes: 7 additions & 7 deletions geomedea/src/http_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ impl Selection {
}
}
};
Box::pin(stream)
stream
}

async fn next_feature_buffer(
Expand Down Expand Up @@ -618,24 +618,24 @@ impl Selection {
}
}

pub struct FeatureStream<'a> {
inner: Box<dyn Stream<Item = Result<Feature>> + Unpin + 'a>,
pub struct FeatureStream {
inner: Box<dyn Stream<Item = Result<Feature>> + Unpin>,
}

impl<'a> FeatureStream<'a> {
fn new(stream: impl Stream<Item = Result<Bytes>> + Unpin + 'a) -> Self {
impl FeatureStream {
fn new(stream: impl Stream<Item = Result<Bytes>> + 'static) -> Self {
let inner = stream.map(move |feature_buffer| {
let feature = deserialize_from::<_, Feature>(feature_buffer?.as_ref())?;
// trace!("yielding feature: {feature:?}");
Ok(feature)
});
Self {
inner: Box::new(inner),
inner: Box::new(Box::pin(inner))
}
}
}

impl Stream for FeatureStream<'_> {
impl Stream for FeatureStream {
type Item = Result<Feature>;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Expand Down
2 changes: 1 addition & 1 deletion geomedea_geozero/src/geozero_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ mod processing {
/// # }
/// ```
pub async fn process_features<W: FeatureProcessor>(
stream: &mut FeatureStream<'_>,
stream: &mut FeatureStream,
out: &mut W,
) -> GeozeroResult<()> {
out.dataset_begin(None)?;
Expand Down

0 comments on commit 9ee2343

Please sign in to comment.