From e96d4114a900dc54e22951b54c9d1ec95b1138db Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 11 Apr 2023 00:43:57 +0200 Subject: [PATCH] helpers -> utils --- lychee-lib/src/collector.rs | 2 +- lychee-lib/src/extract/mod.rs | 2 +- lychee-lib/src/extract/plaintext.rs | 2 +- lychee-lib/src/lib.rs | 2 +- lychee-lib/src/types/error.rs | 4 ++-- lychee-lib/src/types/input.rs | 4 ++-- lychee-lib/src/{helpers => utils}/mod.rs | 0 lychee-lib/src/{helpers => utils}/path.rs | 0 lychee-lib/src/{helpers => utils}/request.rs | 2 +- lychee-lib/src/{helpers => utils}/reqwest.rs | 0 lychee-lib/src/{helpers => utils}/url.rs | 0 11 files changed, 9 insertions(+), 9 deletions(-) rename lychee-lib/src/{helpers => utils}/mod.rs (100%) rename lychee-lib/src/{helpers => utils}/path.rs (100%) rename lychee-lib/src/{helpers => utils}/request.rs (99%) rename lychee-lib/src/{helpers => utils}/reqwest.rs (100%) rename lychee-lib/src/{helpers => utils}/url.rs (100%) diff --git a/lychee-lib/src/collector.rs b/lychee-lib/src/collector.rs index 515302b..111d532 100644 --- a/lychee-lib/src/collector.rs +++ b/lychee-lib/src/collector.rs @@ -1,5 +1,5 @@ use crate::{ - extract::Extractor, helpers::request, types::uri::raw::RawUri, Base, Input, Request, Result, + extract::Extractor, utils::request, types::uri::raw::RawUri, Base, Input, Request, Result, }; use futures::{ stream::{self, Stream}, diff --git a/lychee-lib/src/extract/mod.rs b/lychee-lib/src/extract/mod.rs index 96aab46..e131cc0 100644 --- a/lychee-lib/src/extract/mod.rs +++ b/lychee-lib/src/extract/mod.rs @@ -86,7 +86,7 @@ mod tests { use super::*; use crate::{ - helpers::url::find_links, + utils::url::find_links, test_utils::{load_fixture, mail, website}, types::{FileType, InputContent, InputSource}, Uri, diff --git a/lychee-lib/src/extract/plaintext.rs b/lychee-lib/src/extract/plaintext.rs index 7032a60..8daacad 100644 --- a/lychee-lib/src/extract/plaintext.rs +++ b/lychee-lib/src/extract/plaintext.rs @@ -1,4 +1,4 @@ -use crate::{helpers::url, types::uri::raw::RawUri}; +use crate::{utils::url, types::uri::raw::RawUri}; /// Extract unparsed URL strings from plaintext pub(crate) fn extract_plaintext(input: &str) -> Vec { diff --git a/lychee-lib/src/lib.rs b/lychee-lib/src/lib.rs index 872a617..994c97b 100644 --- a/lychee-lib/src/lib.rs +++ b/lychee-lib/src/lib.rs @@ -53,7 +53,7 @@ doc_comment::doctest!("../../README.md"); mod client; /// A pool of clients, to handle concurrent checks pub mod collector; -mod helpers; +mod utils; mod quirks; mod retry; mod types; diff --git a/lychee-lib/src/types/error.rs b/lychee-lib/src/types/error.rs index 09ee85a..0f964ec 100644 --- a/lychee-lib/src/types/error.rs +++ b/lychee-lib/src/types/error.rs @@ -6,7 +6,7 @@ use thiserror::Error; use tokio::task::JoinError; use super::InputContent; -use crate::{helpers, Uri}; +use crate::{utils, Uri}; /// Kinds of status errors /// Note: The error messages can change over time, so don't match on the output @@ -148,7 +148,7 @@ impl ErrorKind { .to_string(), ) } else { - Some(helpers::reqwest::trim_error_output(e)) + Some(utils::reqwest::trim_error_output(e)) } } ErrorKind::GithubRequest(e) => match e { diff --git a/lychee-lib/src/types/input.rs b/lychee-lib/src/types/input.rs index 7712ae1..7229003 100644 --- a/lychee-lib/src/types/input.rs +++ b/lychee-lib/src/types/input.rs @@ -1,5 +1,5 @@ use crate::types::FileType; -use crate::{helpers, ErrorKind, Result}; +use crate::{utils, ErrorKind, Result}; use async_stream::try_stream; use futures::stream::Stream; use glob::glob_with; @@ -366,7 +366,7 @@ impl Input { /// This is a standalone function to allow for easier testing fn is_excluded_path(excluded_paths: &[PathBuf], path: &PathBuf) -> bool { for excluded in excluded_paths { - if let Ok(true) = helpers::path::contains(excluded, path) { + if let Ok(true) = utils::path::contains(excluded, path) { return true; } } diff --git a/lychee-lib/src/helpers/mod.rs b/lychee-lib/src/utils/mod.rs similarity index 100% rename from lychee-lib/src/helpers/mod.rs rename to lychee-lib/src/utils/mod.rs diff --git a/lychee-lib/src/helpers/path.rs b/lychee-lib/src/utils/path.rs similarity index 100% rename from lychee-lib/src/helpers/path.rs rename to lychee-lib/src/utils/path.rs diff --git a/lychee-lib/src/helpers/request.rs b/lychee-lib/src/utils/request.rs similarity index 99% rename from lychee-lib/src/helpers/request.rs rename to lychee-lib/src/utils/request.rs index 2d2ff00..8d4c9ee 100644 --- a/lychee-lib/src/helpers/request.rs +++ b/lychee-lib/src/utils/request.rs @@ -7,7 +7,7 @@ use std::{ }; use crate::{ - helpers::{path, url}, + utils::{path, url}, types::{uri::raw::RawUri, InputContent, InputSource}, Base, ErrorKind, Request, Result, Uri, }; diff --git a/lychee-lib/src/helpers/reqwest.rs b/lychee-lib/src/utils/reqwest.rs similarity index 100% rename from lychee-lib/src/helpers/reqwest.rs rename to lychee-lib/src/utils/reqwest.rs diff --git a/lychee-lib/src/helpers/url.rs b/lychee-lib/src/utils/url.rs similarity index 100% rename from lychee-lib/src/helpers/url.rs rename to lychee-lib/src/utils/url.rs