We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a8bfaf commit 45736bbCopy full SHA for 45736bb
crates/generate_blog/src/main.rs
@@ -94,14 +94,15 @@ fn main() -> Result<(), Box<dyn Error>> {
94
95
let team = team_prompt.prompt()?;
96
97
- let prefilled_url = team_data
+ let url = if let Some(url) = team_data
98
.as_ref()
99
- .and_then(|teams| find_team_url(teams, &team))
100
- .unwrap_or_else(|| BASE_TEAM_WEBSITE_URL.to_string());
101
-
102
- let url = Text::new("At what URL can people find the team?")
103
- .with_initial_value(&prefilled_url)
104
- .prompt()?;
+ .and_then(|teams| find_team_url(teams, &team)) {
+ url
+ } else {
+ Text::new("At what URL can people find the team?")
+ .with_initial_value(&BASE_TEAM_WEBSITE_URL)
+ .prompt()?
105
+ };
106
(Some(team), Some(url))
107
};
108
0 commit comments