Skip to content

Commit

Permalink
Add missing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Techassi committed Jul 15, 2023
1 parent 37e21e3 commit 3282463
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lychee-lib/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ impl Collector {
self
}

/// TODO
/// Collect all sources from a list of [`Input`]s. For further details,
/// see also [`Input::get_sources`](crate::Input#method.get_sources).
pub async fn collect_sources(self, inputs: Vec<Input>) -> impl Stream<Item = Result<String>> {
stream::iter(inputs)
.par_then_unordered(None, move |input| async move { input.get_sources().await })
Expand Down
12 changes: 11 additions & 1 deletion lychee-lib/src/types/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,17 @@ impl Input {
}
}

/// Retrieve all sources from this input.
/// Retrieve all sources from this input. The output depends on the type of
/// input:
///
/// - Remote URLs are returned as is, in their full form
/// - Filepath Glob Patterns are expanded and each matched entry is returned
/// - Absolute or relative filepaths are returned as is
/// - All other input types are not returned
///
/// # Errors
///
/// Returns an error if the globbing fails with the expanded pattern.
pub async fn get_sources(self) -> impl Stream<Item = Result<String>> {
try_stream! {
match self.source {
Expand Down

0 comments on commit 3282463

Please sign in to comment.