Skip to content

Commit

Permalink
fix: fix issues related to previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Feb 2, 2024
1 parent d40c7fa commit c9eab73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/from_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ impl App {
} else {
""
},
)
)?

Check failure on line 431 in src/app/from_string.rs

View workflow job for this annotation

GitHub Actions / clippy

the `?` operator can only be used in a closure that returns `Result` or `Option` (or another type that implements `std::ops::FromResidual`)

error[E0277]: the `?` operator can only be used in a closure that returns `Result` or `Option` (or another type that implements `std::ops::FromResidual`) --> src/app/from_string.rs:431:30 | 418 | let artifact = artifact_id.unwrap_or_else(|| { | -- this function should return `Result` or `Option` to accept `?` ... 431 | )? | ^ cannot use the `?` operator in a closure that returns `std::string::String` | = help: the trait `std::ops::FromResidual<std::result::Result<std::convert::Infallible, anyhow::Error>>` is not implemented for `std::string::String`
});

let mut versions = vec![SelectItem(
Expand Down
6 changes: 1 addition & 5 deletions src/sources/hangar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ impl<'a> HangarAPI<'a> {
pub fn get_versions_filter(&self) -> mcapi::hangar::VersionsFilter {
let platform = self.get_platform();
mcapi::hangar::VersionsFilter {
platform_version: if platform.is_some() {
Some(self.0.mc_version())
} else {
None
},
platform_version: platform.map(|_| self.0.mc_version().to_owned()),
platform,
..Default::default()
}
Expand Down
4 changes: 2 additions & 2 deletions src/sources/modrinth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ impl<'a> ModrinthAPI<'a> {
let loader = self.get_modrinth_name();

list.iter()
.filter(|v| is_proxy || v.game_versions.contains(mcver))
.filter(|v| is_proxy || v.game_versions.iter().any(|s| s.as_str() == mcver))
.filter(|v| {
if let Some(n) = loader {
v.loaders
.iter()
.any(|l| l == "datapack" || l == n || (l == "fabric" && n == "quilt"))
} else if is_vanilla {
v.loaders.contains(&"datapack".to_owned())
v.loaders.iter().any(|s| s.as_str() == "datapack")
} else {
true
}
Expand Down

0 comments on commit c9eab73

Please sign in to comment.