Open jyn514 opened 11 months ago
also, stream::stream::flatten::Flatten
in the type name looks wrong, that should start with futures
or futures_util
. https://docs.rs/futures/latest/futures/prelude/future/struct.Flatten.html
(for posterity, this code does compile)
let azure_stream = blob_client.get().into_stream().map_ok(|chunk| {
chunk.data
}).try_flatten();
Code
Current output
Desired output
No response
Rationale and extra context
There are a few things that could be improved from this output.
azure_stream
. Maybe it would be good to only suggest types which can be created from any of the intermediate types? e.g.into_stream
returns aPageable<GetBlobResponse>
that implements stream, so suggest that type and things likeMap<Pageable>
?flat_map
, which is good, but it would be even better if it pointed at the place where it infers the return type of the closure (line 6). The signature offlat_map
isand the error complains about
U
, so it should point toU
.wrap_stream
is quite confusing. Here is the signature of wrap_stream:As far as I can tell, the problem here is actually the same as before:
flat_map
requiresU
to implementStream
. But the error has somehow lost the context offlat_map
, and doesn't know how to nameU
, and so it settles for "required forFlatten<Map<Pageable<..., ...>, ...>, ...>
to implementStream
". I think this error should just be hidden altogether, it doesn't add any info.Other cases
No response
Anything else?
The full type name written to disk is
stream::stream::flatten::Flatten<futures_util::stream::Map<azure_core::pageable::pageable::Pageable<GetBlobResponse, azure_core::error::Error>, {closure@src/main.rs:5:65: 5:72}>, Result<azure_core::response::ResponseBody, azure_core::error::Error>>
.