Use consistent argument ordering for Dist conversions (#3868)

This commit is contained in:
Charlie Marsh 2024-05-27 15:48:58 -04:00 committed by GitHub
parent 3c61eabd9d
commit 22dbc79994
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -287,9 +287,9 @@ impl Dist {
/// URL. /// URL.
pub fn from_http_url( pub fn from_http_url(
name: PackageName, name: PackageName,
url: VerbatimUrl,
location: Url, location: Url,
subdirectory: Option<PathBuf>, subdirectory: Option<PathBuf>,
url: VerbatimUrl,
) -> Result<Dist, Error> { ) -> Result<Dist, Error> {
if Path::new(url.path()) if Path::new(url.path())
.extension() .extension()
@ -323,9 +323,9 @@ impl Dist {
/// A local built or source distribution from a `file://` URL. /// A local built or source distribution from a `file://` URL.
pub fn from_file_url( pub fn from_file_url(
name: PackageName, name: PackageName,
url: VerbatimUrl,
path: &Path, path: &Path,
editable: bool, editable: bool,
url: VerbatimUrl,
) -> Result<Dist, Error> { ) -> Result<Dist, Error> {
// Store the canonicalized path, which also serves to validate that it exists. // Store the canonicalized path, which also serves to validate that it exists.
let path = match path.canonicalize() { let path = match path.canonicalize() {
@ -399,9 +399,9 @@ impl Dist {
pub fn from_url(name: PackageName, url: VerbatimParsedUrl) -> Result<Self, Error> { pub fn from_url(name: PackageName, url: VerbatimParsedUrl) -> Result<Self, Error> {
match url.parsed_url { match url.parsed_url {
ParsedUrl::Archive(archive) => { ParsedUrl::Archive(archive) => {
Self::from_http_url(name, archive.url, archive.subdirectory, url.verbatim) Self::from_http_url(name, url.verbatim, archive.url, archive.subdirectory)
} }
ParsedUrl::Path(file) => Self::from_file_url(name, &file.path, false, url.verbatim), ParsedUrl::Path(file) => Self::from_file_url(name, url.verbatim, &file.path, false),
ParsedUrl::Git(git) => { ParsedUrl::Git(git) => {
Self::from_git_url(name, url.verbatim, git.url, git.subdirectory) Self::from_git_url(name, url.verbatim, git.url, git.subdirectory)
} }

View file

@ -160,7 +160,7 @@ impl<'a, Context: BuildContext> LookaheadResolver<'a, Context> {
subdirectory, subdirectory,
location, location,
url, url,
} => Dist::from_http_url(requirement.name, location, subdirectory, url)?, } => Dist::from_http_url(requirement.name, url, location, subdirectory)?,
RequirementSource::Git { RequirementSource::Git {
repository, repository,
reference, reference,
@ -184,7 +184,7 @@ impl<'a, Context: BuildContext> LookaheadResolver<'a, Context> {
url, url,
// TODO(konsti): Figure out why we lose the editable here (does it matter?) // TODO(konsti): Figure out why we lose the editable here (does it matter?)
editable: _, editable: _,
} => Dist::from_file_url(requirement.name, &path, false, url)?, } => Dist::from_file_url(requirement.name, url, &path, false)?,
}; };
// Fetch the metadata for the distribution. // Fetch the metadata for the distribution.