Skip to content
Prev Previous commit
Next Next commit
fmt and lint
  • Loading branch information
katrinafyi committed Aug 31, 2025
commit cb63ef4ee9db311136c30290156357593e29501f
1 change: 0 additions & 1 deletion lychee-lib/src/types/input/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//! The `InputContent` type represents the actual content extracted from various
//! input sources, along with metadata about the source and file type.

use super::source::InputSource;
use super::source::ResolvedInputSource;
use crate::ErrorKind;
use crate::types::FileType;
Expand Down
13 changes: 11 additions & 2 deletions lychee-lib/src/types/input/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ pub enum InputSource {
pub enum ResolvedInputSource {
/// URL (of HTTP/HTTPS scheme).
RemoteUrl(Box<Url>),
/// File path.
/// File path, possibly resolved from a [`InputSource::FsGlob`].
///
/// The [`Option`] field, if specified, records the `pattern`
/// and `ignore_case` of the [`InputSource::FsGlob`] which resolved
/// to this [`ResolvedInputSource::FsPath`].
FsPath(PathBuf, Option<(String, bool)>),
/// Standard Input.
Stdin,
Expand All @@ -65,7 +69,12 @@ impl From<ResolvedInputSource> for InputSource {
match resolved {
ResolvedInputSource::RemoteUrl(url) => InputSource::RemoteUrl(url),
ResolvedInputSource::FsPath(path, None) => InputSource::FsPath(path),
ResolvedInputSource::FsPath(path, Some((pattern, ignore_case))) => InputSource::FsGlob {pattern, ignore_case},
ResolvedInputSource::FsPath(_path, Some((pattern, ignore_case))) => {
InputSource::FsGlob {
pattern,
ignore_case,
}
}
ResolvedInputSource::Stdin => InputSource::Stdin,
ResolvedInputSource::String(s) => InputSource::String(s),
}
Expand Down
9 changes: 7 additions & 2 deletions lychee-lib/src/types/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::{convert::TryFrom, fmt::Display};

use crate::{BasicAuthCredentials, ErrorKind, Uri};

use super::InputSource;
use super::ResolvedInputSource;

/// A request type that can be handle by lychee
Expand Down Expand Up @@ -73,7 +72,13 @@ impl TryFrom<String> for Request {

fn try_from(s: String) -> Result<Self, Self::Error> {
let uri = Uri::try_from(s.as_str())?;
Ok(Request::new(uri, ResolvedInputSource::String(s), None, None, None))
Ok(Request::new(
uri,
ResolvedInputSource::String(s),
None,
None,
None,
))
}
}

Expand Down
4 changes: 2 additions & 2 deletions lychee-lib/src/types/resolver.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use super::{FileType, InputContent, InputSource};
use super::{FileType, InputContent};
use crate::types::input::source::ResolvedInputSource;
use crate::utils::request;
use crate::{BasicAuthExtractor, ErrorKind, Result, Uri};
use http::HeaderMap;
use reqwest::{Client, Request, Url};
use crate::types::input::source::ResolvedInputSource;

/// Structure to fetch remote content.
#[derive(Debug, Default, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/types/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::fmt::Display;
use http::StatusCode;
use serde::Serialize;

use crate::{InputSource, Status, Uri};
use crate::types::ResolvedInputSource;
use crate::{Status, Uri};

/// Response type returned by lychee after checking a URI
//
Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/utils/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use std::{
path::{Path, PathBuf},
};

use crate::types::ResolvedInputSource;
use crate::{
Base, BasicAuthCredentials, ErrorKind, Request, Result, Uri,
basic_auth::BasicAuthExtractor,
types::{InputSource, uri::raw::RawUri},
utils::{path, url},
};
use crate::types::ResolvedInputSource;

/// Extract basic auth credentials for a given URL.
pub(crate) fn extract_credentials(
Expand Down