diff --git a/crates/rattler_installs_packages/benches/html.rs b/crates/rattler_installs_packages/benches/html.rs index a8d3eb8b..fdca1120 100644 --- a/crates/rattler_installs_packages/benches/html.rs +++ b/crates/rattler_installs_packages/benches/html.rs @@ -1,7 +1,5 @@ use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; -use rattler_installs_packages::html::{ - parse_package_names_html, parse_project_info_html, -}; +use rattler_installs_packages::html::{parse_package_names_html, parse_project_info_html}; use std::str::FromStr; use url::Url; diff --git a/crates/rattler_installs_packages/src/html.rs b/crates/rattler_installs_packages/src/html.rs index 6d05acd3..0ae51a56 100644 --- a/crates/rattler_installs_packages/src/html.rs +++ b/crates/rattler_installs_packages/src/html.rs @@ -11,7 +11,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - use std::{borrow::Borrow, default::Default}; use crate::{ArtifactHashes, ArtifactName}; @@ -42,9 +41,7 @@ pub fn into_artifact_info(base: &Url, tag: &HTMLTag) -> Option { // Join with base let url = base.join(href.as_ref()).ok()?; let filename = url.path_segments().and_then(|mut s| s.next_back()); - let filename: ArtifactName = filename - .map(|s| s.parse())? - .ok()?; + let filename: ArtifactName = filename.map(|s| s.parse())?.ok()?; // We found a valid link let hash = url.fragment().and_then(parse_hash); diff --git a/crates/rattler_installs_packages/src/lib.rs b/crates/rattler_installs_packages/src/lib.rs index c7ad6d24..dcbaa8e1 100644 --- a/crates/rattler_installs_packages/src/lib.rs +++ b/crates/rattler_installs_packages/src/lib.rs @@ -1,6 +1,6 @@ mod artifact; -pub mod artifact_name; -pub mod core_metadata; +mod artifact_name; +mod core_metadata; mod extra; mod file_store; pub mod html; @@ -9,7 +9,7 @@ mod package_database; mod package_name; mod project_info; mod reqparse; -pub mod requirement; +mod requirement; mod rfc822ish; mod seek_slice; mod specifier; @@ -19,10 +19,15 @@ pub use file_store::{CacheKey, FileStore}; pub use package_database::PackageDb; pub use artifact::{Artifact, MetadataArtifact, Wheel}; -pub use artifact_name::ArtifactName; +pub use artifact_name::{ + ArtifactName, BuildTag, InnerAsArtifactName, ParseArtifactNameError, SDistFormat, SDistName, + WheelName, +}; pub use extra::Extra; pub use package_name::{NormalizedPackageName, PackageName, ParsePackageNameError}; pub use pep440::Version; -pub use project_info::{ArtifactHashes, ArtifactInfo, DistInfoMetadata, Meta, Yanked}; -pub use requirement::PackageRequirement; +pub use project_info::{ArtifactHashes, ArtifactInfo, DistInfoMetadata, Meta, ProjectInfo, Yanked}; +pub use requirement::{ + marker, PackageRequirement, ParseExtra, PythonRequirement, Requirement, UserRequirement, +}; pub use specifier::{CompareOp, Specifier, Specifiers}; diff --git a/crates/rattler_installs_packages/src/package_database.rs b/crates/rattler_installs_packages/src/package_database.rs index d5521947..dbfa2967 100644 --- a/crates/rattler_installs_packages/src/package_database.rs +++ b/crates/rattler_installs_packages/src/package_database.rs @@ -19,7 +19,7 @@ use pep440::Version; use reqwest::{header::CACHE_CONTROL, Client, StatusCode}; use std::borrow::Borrow; use std::fmt::Display; -use std::io::{Read}; +use std::io::Read; use std::path::PathBuf; use url::Url; @@ -311,8 +311,8 @@ async fn fetch_simple_api(http: &Http, url: Url) -> miette::Result