Skip to content

Commit 7b3bb29

Browse files
committed
examples: fixes to comply with Into<Option<_>>
1 parent 8e7fb3c commit 7b3bb29

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

examples/column_view_datagrid/grid_cell/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ impl Default for GridCell {
1919

2020
impl GridCell {
2121
pub fn set_entry(&self, entry: &Entry) {
22-
self.imp().name.set_text(Some(&entry.name));
22+
self.imp().name.set_text(entry.name.as_str());
2323
}
2424
}

examples/dialog/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async fn dialog<W: IsA<gtk::Window>>(window: W) {
5656
let info_dialog = gtk::AlertDialog::builder()
5757
.modal(true)
5858
.message("You answered")
59-
.detail(format!("Your answer: {answer:?}"))
59+
.detail(format!("Your answer: {answer:?}").as_str())
6060
.build();
6161

6262
info_dialog.show(Some(&window));

examples/list_view_apps_launcher/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ fn build_ui(app: &gtk::Application) {
7676
let parent_window = list_view.root().and_downcast::<gtk::Window>().unwrap();
7777

7878
gtk::AlertDialog::builder()
79-
.message(format!("Failed to start {}", app_info.name()))
80-
.detail(err.to_string())
79+
.message(format!("Failed to start {}", app_info.name()).as_str())
80+
.detail(err.to_string().as_str())
8181
.modal(true)
8282
.build()
8383
.show(Some(&parent_window));

examples/tokio_async_request/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn build_ui(app: &Application) {
9595
match response {
9696
Ok(response) => {
9797
for pokemon in response {
98-
let label = gtk::Label::new(Some(&pokemon.name));
98+
let label = gtk::Label::new(pokemon.name.as_str());
9999
label.set_halign(gtk::Align::Start);
100100
list_box.append(&label);
101101
}

0 commit comments

Comments
 (0)