Skip to content

Commit

Permalink
refactor: remove is_compatible_with
Browse files Browse the repository at this point in the history
  • Loading branch information
daimond113 committed Sep 27, 2024
1 parent 10c804e commit bc86c2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
18 changes: 0 additions & 18 deletions src/manifest/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,6 @@ impl TargetKind {
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
/// self is the project's target, dependency is the target of the dependency
pub fn packages_folder(&self, dependency: &Self) -> String {
Expand Down
4 changes: 1 addition & 3 deletions src/source/pesde/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ impl PackageSource for PesdePackageSource {
.into_iter()
.filter(|(VersionId(version, target), _)| {
specifier.version.matches(version)
&& specifier
.target
.map_or(package_target.is_compatible_with(target), |t| t == *target)
&& specifier.target.unwrap_or(package_target) == *target
})
.map(|(id, entry)| {
let version = id.version().clone();
Expand Down

0 comments on commit bc86c2f

Please sign in to comment.