change format("{}", VAR) to VAR.to_string()
This commit is contained in:
parent
b91855ca94
commit
afe583034a
3 changed files with 13 additions and 13 deletions
|
@ -56,7 +56,7 @@ impl super::View for TableDemo {
|
||||||
if self.virtual_scrool {
|
if self.virtual_scrool {
|
||||||
body.rows(20.0, 100_000, |index, mut row| {
|
body.rows(20.0, 100_000, |index, mut row| {
|
||||||
row.col(|ui| {
|
row.col(|ui| {
|
||||||
ui.label(format!("{}", index));
|
ui.label(index.to_string());
|
||||||
});
|
});
|
||||||
row.col(|ui| {
|
row.col(|ui| {
|
||||||
ui.add(
|
ui.add(
|
||||||
|
@ -65,7 +65,7 @@ impl super::View for TableDemo {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
row.col(|ui| {
|
row.col(|ui| {
|
||||||
ui.label(format!("{}", index));
|
ui.label(index.to_string());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -77,7 +77,7 @@ impl super::View for TableDemo {
|
||||||
};
|
};
|
||||||
body.row(height, |mut row| {
|
body.row(height, |mut row| {
|
||||||
row.col(|ui| {
|
row.col(|ui| {
|
||||||
ui.label(format!("{}", i));
|
ui.label(i.to_string());
|
||||||
});
|
});
|
||||||
row.col(|ui| {
|
row.col(|ui| {
|
||||||
ui.add(
|
ui.add(
|
||||||
|
@ -88,7 +88,7 @@ impl super::View for TableDemo {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
row.col(|ui| {
|
row.col(|ui| {
|
||||||
ui.label(format!("{}", i));
|
ui.label(i.to_string());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ pub fn serialize<S>(date: &Date<Utc>, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
where
|
where
|
||||||
S: Serializer,
|
S: Serializer,
|
||||||
{
|
{
|
||||||
let s = format!("{}", date.format(FORMAT));
|
let s = date.format(FORMAT).to_string();
|
||||||
serializer.serialize_str(&s)
|
serializer.serialize_str(&s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,14 +72,14 @@ impl<'a> DatePickerPopup<'a> {
|
||||||
builder.sizes(Size::Remainder, 3).horizontal(|mut grid| {
|
builder.sizes(Size::Remainder, 3).horizontal(|mut grid| {
|
||||||
grid.cell_noclip(|ui| {
|
grid.cell_noclip(|ui| {
|
||||||
ComboBox::from_id_source("date_picker_year")
|
ComboBox::from_id_source("date_picker_year")
|
||||||
.selected_text(format!("{}", popup_state.year))
|
.selected_text(popup_state.year.to_string())
|
||||||
.show_ui(ui, |ui| {
|
.show_ui(ui, |ui| {
|
||||||
for year in today.year() - 5..today.year() + 10 {
|
for year in today.year() - 5..today.year() + 10 {
|
||||||
if ui
|
if ui
|
||||||
.selectable_value(
|
.selectable_value(
|
||||||
&mut popup_state.year,
|
&mut popup_state.year,
|
||||||
year,
|
year,
|
||||||
format!("{}", year),
|
year.to_string(),
|
||||||
)
|
)
|
||||||
.changed()
|
.changed()
|
||||||
{
|
{
|
||||||
|
@ -92,14 +92,14 @@ impl<'a> DatePickerPopup<'a> {
|
||||||
});
|
});
|
||||||
grid.cell_noclip(|ui| {
|
grid.cell_noclip(|ui| {
|
||||||
ComboBox::from_id_source("date_picker_month")
|
ComboBox::from_id_source("date_picker_month")
|
||||||
.selected_text(format!("{}", popup_state.month))
|
.selected_text(popup_state.month.to_string())
|
||||||
.show_ui(ui, |ui| {
|
.show_ui(ui, |ui| {
|
||||||
for month in 1..=12 {
|
for month in 1..=12 {
|
||||||
if ui
|
if ui
|
||||||
.selectable_value(
|
.selectable_value(
|
||||||
&mut popup_state.month,
|
&mut popup_state.month,
|
||||||
month,
|
month,
|
||||||
format!("{}", month),
|
month.to_string(),
|
||||||
)
|
)
|
||||||
.changed()
|
.changed()
|
||||||
{
|
{
|
||||||
|
@ -112,14 +112,14 @@ impl<'a> DatePickerPopup<'a> {
|
||||||
});
|
});
|
||||||
grid.cell_noclip(|ui| {
|
grid.cell_noclip(|ui| {
|
||||||
ComboBox::from_id_source("date_picker_day")
|
ComboBox::from_id_source("date_picker_day")
|
||||||
.selected_text(format!("{}", popup_state.day))
|
.selected_text(popup_state.day.to_string())
|
||||||
.show_ui(ui, |ui| {
|
.show_ui(ui, |ui| {
|
||||||
for day in 1..=popup_state.last_day_of_month() {
|
for day in 1..=popup_state.last_day_of_month() {
|
||||||
if ui
|
if ui
|
||||||
.selectable_value(
|
.selectable_value(
|
||||||
&mut popup_state.day,
|
&mut popup_state.day,
|
||||||
day,
|
day,
|
||||||
format!("{}", day),
|
day.to_string(),
|
||||||
)
|
)
|
||||||
.changed()
|
.changed()
|
||||||
{
|
{
|
||||||
|
@ -263,7 +263,7 @@ impl<'a> DatePickerPopup<'a> {
|
||||||
body.row(height, |mut row| {
|
body.row(height, |mut row| {
|
||||||
if self.calendar_week {
|
if self.calendar_week {
|
||||||
row.col(|ui| {
|
row.col(|ui| {
|
||||||
ui.add(Label::new(format!("{}", week.number)));
|
ui.add(Label::new(week.number.to_string()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
for day in week.days {
|
for day in week.days {
|
||||||
|
@ -294,7 +294,7 @@ impl<'a> DatePickerPopup<'a> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let button = Button::new(
|
let button = Button::new(
|
||||||
RichText::new(format!("{}", day.day()))
|
RichText::new(day.day().to_string())
|
||||||
.color(text_color),
|
.color(text_color),
|
||||||
)
|
)
|
||||||
.fill(fill_color);
|
.fill(fill_color);
|
||||||
|
|
Loading…
Reference in a new issue