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 {
|
||||
body.rows(20.0, 100_000, |index, mut row| {
|
||||
row.col(|ui| {
|
||||
ui.label(format!("{}", index));
|
||||
ui.label(index.to_string());
|
||||
});
|
||||
row.col(|ui| {
|
||||
ui.add(
|
||||
|
@ -65,7 +65,7 @@ impl super::View for TableDemo {
|
|||
);
|
||||
});
|
||||
row.col(|ui| {
|
||||
ui.label(format!("{}", index));
|
||||
ui.label(index.to_string());
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
@ -77,7 +77,7 @@ impl super::View for TableDemo {
|
|||
};
|
||||
body.row(height, |mut row| {
|
||||
row.col(|ui| {
|
||||
ui.label(format!("{}", i));
|
||||
ui.label(i.to_string());
|
||||
});
|
||||
row.col(|ui| {
|
||||
ui.add(
|
||||
|
@ -88,7 +88,7 @@ impl super::View for TableDemo {
|
|||
);
|
||||
});
|
||||
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
|
||||
S: Serializer,
|
||||
{
|
||||
let s = format!("{}", date.format(FORMAT));
|
||||
let s = date.format(FORMAT).to_string();
|
||||
serializer.serialize_str(&s)
|
||||
}
|
||||
|
||||
|
|
|
@ -72,14 +72,14 @@ impl<'a> DatePickerPopup<'a> {
|
|||
builder.sizes(Size::Remainder, 3).horizontal(|mut grid| {
|
||||
grid.cell_noclip(|ui| {
|
||||
ComboBox::from_id_source("date_picker_year")
|
||||
.selected_text(format!("{}", popup_state.year))
|
||||
.selected_text(popup_state.year.to_string())
|
||||
.show_ui(ui, |ui| {
|
||||
for year in today.year() - 5..today.year() + 10 {
|
||||
if ui
|
||||
.selectable_value(
|
||||
&mut popup_state.year,
|
||||
year,
|
||||
format!("{}", year),
|
||||
year.to_string(),
|
||||
)
|
||||
.changed()
|
||||
{
|
||||
|
@ -92,14 +92,14 @@ impl<'a> DatePickerPopup<'a> {
|
|||
});
|
||||
grid.cell_noclip(|ui| {
|
||||
ComboBox::from_id_source("date_picker_month")
|
||||
.selected_text(format!("{}", popup_state.month))
|
||||
.selected_text(popup_state.month.to_string())
|
||||
.show_ui(ui, |ui| {
|
||||
for month in 1..=12 {
|
||||
if ui
|
||||
.selectable_value(
|
||||
&mut popup_state.month,
|
||||
month,
|
||||
format!("{}", month),
|
||||
month.to_string(),
|
||||
)
|
||||
.changed()
|
||||
{
|
||||
|
@ -112,14 +112,14 @@ impl<'a> DatePickerPopup<'a> {
|
|||
});
|
||||
grid.cell_noclip(|ui| {
|
||||
ComboBox::from_id_source("date_picker_day")
|
||||
.selected_text(format!("{}", popup_state.day))
|
||||
.selected_text(popup_state.day.to_string())
|
||||
.show_ui(ui, |ui| {
|
||||
for day in 1..=popup_state.last_day_of_month() {
|
||||
if ui
|
||||
.selectable_value(
|
||||
&mut popup_state.day,
|
||||
day,
|
||||
format!("{}", day),
|
||||
day.to_string(),
|
||||
)
|
||||
.changed()
|
||||
{
|
||||
|
@ -263,7 +263,7 @@ impl<'a> DatePickerPopup<'a> {
|
|||
body.row(height, |mut row| {
|
||||
if self.calendar_week {
|
||||
row.col(|ui| {
|
||||
ui.add(Label::new(format!("{}", week.number)));
|
||||
ui.add(Label::new(week.number.to_string()));
|
||||
});
|
||||
}
|
||||
for day in week.days {
|
||||
|
@ -294,7 +294,7 @@ impl<'a> DatePickerPopup<'a> {
|
|||
};
|
||||
|
||||
let button = Button::new(
|
||||
RichText::new(format!("{}", day.day()))
|
||||
RichText::new(day.day().to_string())
|
||||
.color(text_color),
|
||||
)
|
||||
.fill(fill_color);
|
||||
|
|
Loading…
Reference in a new issue