@@ -42,26 +42,21 @@ impl TreeStore {
42
42
as u32 ;
43
43
assert ! (
44
44
columns_and_values. len( ) <= n_columns as usize ,
45
- "got values for {} columns but only {} columns exist" ,
45
+ "got values for {} columns but only {n_columns } columns exist" ,
46
46
columns_and_values. len( ) ,
47
- n_columns
48
47
) ;
49
48
for ( column, value) in columns_and_values {
50
49
assert ! (
51
50
* column < n_columns,
52
- "got column {} which is higher than the number of columns {}" ,
53
- * column,
54
- n_columns
51
+ "got column {column} which is higher than the number of columns {n_columns}" ,
55
52
) ;
56
53
let type_ = from_glib ( ffi:: gtk_tree_model_get_column_type (
57
54
self . upcast_ref :: < TreeModel > ( ) . to_glib_none ( ) . 0 ,
58
55
* column as c_int ,
59
56
) ) ;
60
57
assert ! (
61
58
Value :: type_transformable( value. value_type( ) , type_) ,
62
- "column {} is of type {} but found value of type {}" ,
63
- * column,
64
- type_,
59
+ "column {column} is of type {} but found value of type {type_}" ,
65
60
value. value_type( )
66
61
) ;
67
62
}
@@ -100,8 +95,7 @@ impl TreeStore {
100
95
let safe_count = count as usize == new_order. len ( ) ;
101
96
debug_assert ! (
102
97
safe_count,
103
- "Incorrect `new_order` slice length. Expected `{}`, found `{}`." ,
104
- count,
98
+ "Incorrect `new_order` slice length. Expected `{count}`, found `{}`." ,
105
99
new_order. len( )
106
100
) ;
107
101
let safe_values = new_order. iter ( ) . max ( ) . map_or ( true , |& max| {
@@ -111,9 +105,8 @@ impl TreeStore {
111
105
debug_assert ! (
112
106
safe_values,
113
107
"Some `new_order` slice values are out of range. Maximum safe value: \
114
- `{}`. The slice contents: `{:?}`",
108
+ `{}`. The slice contents: `{new_order :?}`",
115
109
count - 1 ,
116
- new_order
117
110
) ;
118
111
if safe_count && safe_values {
119
112
ffi:: gtk_tree_store_reorder (
@@ -136,26 +129,21 @@ impl TreeStore {
136
129
as u32 ;
137
130
assert ! (
138
131
columns_and_values. len( ) <= n_columns as usize ,
139
- "got values for {} columns but only {} columns exist" ,
132
+ "got values for {} columns but only {n_columns } columns exist" ,
140
133
columns_and_values. len( ) ,
141
- n_columns
142
134
) ;
143
135
for ( column, value) in columns_and_values {
144
136
assert ! (
145
137
* column < n_columns,
146
- "got column {} which is higher than the number of columns {}" ,
147
- * column,
148
- n_columns
138
+ "got column {column} which is higher than the number of columns {n_columns}" ,
149
139
) ;
150
140
let type_ = from_glib ( ffi:: gtk_tree_model_get_column_type (
151
141
self . upcast_ref :: < TreeModel > ( ) . to_glib_none ( ) . 0 ,
152
142
* column as c_int ,
153
143
) ) ;
154
144
assert ! (
155
145
Value :: type_transformable( value. value_type( ) , type_) ,
156
- "column {} is of type {} but found value of type {}" ,
157
- * column,
158
- type_,
146
+ "column {column} is of type {type_} but found value of type {}" ,
159
147
value. value_type( )
160
148
) ;
161
149
}
@@ -201,9 +189,7 @@ impl TreeStore {
201
189
as u32 ;
202
190
assert ! (
203
191
column < columns,
204
- "got column {} which is higher than the number of columns {}" ,
205
- column,
206
- columns
192
+ "got column {column} which is higher than the number of columns {columns}" ,
207
193
) ;
208
194
209
195
let type_ = from_glib ( ffi:: gtk_tree_model_get_column_type (
@@ -212,9 +198,7 @@ impl TreeStore {
212
198
) ) ;
213
199
assert ! (
214
200
Value :: type_transformable( value. type_( ) , type_) ,
215
- "column {} is of type {} but found value of type {}" ,
216
- column,
217
- type_,
201
+ "column {column} is of type {type_} but found value of type {}" ,
218
202
value. type_( )
219
203
) ;
220
204
0 commit comments