Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox label is now Into<String> #260

Merged
merged 3 commits into from
Apr 6, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions examples/tour/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,9 @@ impl<'a> Step {
.push(Language::all().iter().cloned().fold(
Column::new().padding(10).spacing(20),
|choices, language| {
let label: &str = language.into();
choices.push(Radio::new(
language,
label,
language,
selection,
StepMessage::LanguageSelected,
))
Expand Down Expand Up @@ -730,16 +729,16 @@ impl Language {
}
}

impl From<Language> for &str {
fn from(language: Language) -> &'static str {
match language {
impl From<Language> for String {
fn from(language: Language) -> String {
String::from(match language {
hecrj marked this conversation as resolved.
Show resolved Hide resolved
Language::Rust => "Rust",
Language::Elm => "Elm",
Language::Ruby => "Ruby",
Language::Haskell => "Haskell",
Language::C => "C",
Language::Other => "Other",
}
})
}
}

Expand Down