mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-13 11:50:36 +00:00
refactor: remove is_compatible_with
This commit is contained in:
parent
10c804e2f3
commit
bc86c2f1c5
2 changed files with 1 additions and 21 deletions
|
@ -72,24 +72,6 @@ impl TargetKind {
|
||||||
TargetKind::Luau,
|
TargetKind::Luau,
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Whether this target is compatible with another target
|
|
||||||
/// self is the project's target, dependency is the target of the dependency
|
|
||||||
pub fn is_compatible_with(&self, dependency: &Self) -> bool {
|
|
||||||
if self == dependency {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
match (self, dependency) {
|
|
||||||
#[cfg(all(feature = "lune", feature = "luau"))]
|
|
||||||
(TargetKind::Lune, TargetKind::Luau) => true,
|
|
||||||
|
|
||||||
#[cfg(feature = "roblox")]
|
|
||||||
(TargetKind::RobloxServer, TargetKind::Roblox) => true,
|
|
||||||
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The folder to store packages in for this target
|
/// The folder to store packages in for this target
|
||||||
/// self is the project's target, dependency is the target of the dependency
|
/// self is the project's target, dependency is the target of the dependency
|
||||||
pub fn packages_folder(&self, dependency: &Self) -> String {
|
pub fn packages_folder(&self, dependency: &Self) -> String {
|
||||||
|
|
|
@ -219,9 +219,7 @@ impl PackageSource for PesdePackageSource {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|(VersionId(version, target), _)| {
|
.filter(|(VersionId(version, target), _)| {
|
||||||
specifier.version.matches(version)
|
specifier.version.matches(version)
|
||||||
&& specifier
|
&& specifier.target.unwrap_or(package_target) == *target
|
||||||
.target
|
|
||||||
.map_or(package_target.is_compatible_with(target), |t| t == *target)
|
|
||||||
})
|
})
|
||||||
.map(|(id, entry)| {
|
.map(|(id, entry)| {
|
||||||
let version = id.version().clone();
|
let version = id.version().clone();
|
||||||
|
|
Loading…
Reference in a new issue