Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Feb 2, 2024
1 parent c9eab73 commit ab35948
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/from_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,21 +415,21 @@ impl App {

let suggest = format!("{repo}/{}", group.replace('.', "/"));

let artifact = artifact_id.unwrap_or_else(|| {
self.prompt_string_filled(
let artifact = match artifact_id {
Some(r) => r,
None => self.prompt_string_filled(
"Artifact?",
if urlstr.starts_with(&suggest) {
urlstr
.strip_prefix(&suggest)
.unwrap()
.split('/')
.find(|x| !x.is_empty())

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

View workflow job for this annotation

GitHub Actions / clippy

mismatched types

error[E0308]: mismatched types --> src/app/from_string.rs:423:37 | 423 | / ... urlstr 424 | | ... .strip_prefix(&suggest) 425 | | ... .unwrap() 426 | | ... .split('/') 427 | | ... .find(|x| !x.is_empty()) | |__________________________________________________^ expected `&str`, found `Option<&str>` | = note: expected reference `&str` found enum `std::option::Option<&str>` help: consider using `Option::expect` to unwrap the `std::option::Option<&str>` value, panicking if the value is an `Option::None` | 427 | .find(|x| !x.is_empty()).expect("REASON") | +++++++++++++++++
.unwrap_or_default()
} else {
""
},
)?
});
),

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

View workflow job for this annotation

GitHub Actions / clippy

`match` arms have incompatible types

error[E0308]: `match` arms have incompatible types --> src/app/from_string.rs:420:37 | 418 | let artifact = match artifact_id { | ----------------- `match` arms have incompatible types 419 | Some(r) => r, | - this is found to be of type `std::string::String` 420 | None => self.prompt_string_filled( | _____________________________________^ 421 | | "Artifact?", 422 | | if urlstr.starts_with(&suggest) { 423 | | urlstr ... | 430 | | }, 431 | | ), | |_____________________________^ expected `String`, found `Result<String, Error>` | = note: expected struct `std::string::String` found enum `std::result::Result<std::string::String, anyhow::Error>` help: use the `?` operator to extract the `std::result::Result<std::string::String, anyhow::Error>` value, propagating a `Result::Err` value to the caller | 431 | )?, | +
};

let mut versions = vec![SelectItem(
"latest".to_owned(),
Expand Down

0 comments on commit ab35948

Please sign in to comment.