From 32824636a9916613fd4fe7a8bf326f37ec2e6134 Mon Sep 17 00:00:00 2001 From: Techassi Date: Sat, 15 Jul 2023 15:23:05 +0200 Subject: [PATCH] Add missing documentation --- lychee-lib/src/collector.rs | 3 ++- lychee-lib/src/types/input.rs | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lychee-lib/src/collector.rs b/lychee-lib/src/collector.rs index 532e9fb239..9d94eb1561 100644 --- a/lychee-lib/src/collector.rs +++ b/lychee-lib/src/collector.rs @@ -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) -> impl Stream> { stream::iter(inputs) .par_then_unordered(None, move |input| async move { input.get_sources().await }) diff --git a/lychee-lib/src/types/input.rs b/lychee-lib/src/types/input.rs index 33a5db0f98..3053705cd5 100644 --- a/lychee-lib/src/types/input.rs +++ b/lychee-lib/src/types/input.rs @@ -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> { try_stream! { match self.source {