Skip to content

Commit a9d2c06

Browse files
committed
docs(source): update doc comments for Source trait
1 parent 6fdabf7 commit a9d2c06

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/cargo/core/source/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ pub trait Source {
6262

6363
/// Attempts to find the packages that match a dependency request.
6464
///
65+
/// Usually you should call [`Source::block_until_ready`] somewhere and
66+
/// wait until package informations become available. Otherwise any query
67+
/// may return a [`Poll::Pending`].
68+
///
6569
/// The `f` argument is expected to get called when any [`Summary`] becomes available.
6670
fn query(
6771
&mut self,
@@ -70,8 +74,8 @@ pub trait Source {
7074
f: &mut dyn FnMut(Summary),
7175
) -> Poll<CargoResult<()>>;
7276

73-
/// A helper function that collects and returns the result from
74-
/// [`Source::query`] as a list of [`Summary`] items when available.
77+
/// Gathers the result from [`Source::query`] as a list of [`Summary`] items
78+
/// when they become available.
7579
fn query_vec(&mut self, dep: &Dependency, kind: QueryKind) -> Poll<CargoResult<Vec<Summary>>> {
7680
let mut ret = Vec::new();
7781
self.query(dep, kind, &mut |s| ret.push(s)).map_ok(|_| ret)

0 commit comments

Comments
 (0)