File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ pub trait DatastoreAttachTarget<ResourceType>: Selectable<Pg> + Sized {
182
182
collection_query : BoxedQuery < CollectionTable < ResourceType , Self > > ,
183
183
resource_query : BoxedQuery < ResourceTable < ResourceType , Self > > ,
184
184
185
- max_attached_resources : usize ,
185
+ max_attached_resources : u32 ,
186
186
187
187
// We are intentionally picky about this update statement:
188
188
// - The second argument - the WHERE clause - must match the default
@@ -344,7 +344,7 @@ where
344
344
// A (mostly) user-provided query for validating the resource.
345
345
resource_query : Box < dyn QueryFragment < Pg > + Send > ,
346
346
// The maximum number of resources which may be attached to the collection.
347
- max_attached_resources : usize ,
347
+ max_attached_resources : u32 ,
348
348
349
349
// Update statement for the resource.
350
350
update_resource_statement :
Original file line number Diff line number Diff line change @@ -1171,7 +1171,6 @@ impl DataStore {
1171
1171
let attached_label =
1172
1172
api:: external:: DiskState :: Attached ( authz_instance. id ( ) ) . label ( ) ;
1173
1173
1174
- // TODO "u32" seems reasonable for the max disks value (input / output)
1175
1174
let ( instance, disk) = Instance :: attach_resource (
1176
1175
authz_instance. id ( ) ,
1177
1176
authz_disk. id ( ) ,
@@ -1181,8 +1180,7 @@ impl DataStore {
1181
1180
disk:: table
1182
1181
. into_boxed ( )
1183
1182
. filter ( disk:: dsl:: disk_state. eq_any ( ok_to_attach_disk_state_labels) ) ,
1184
- // TODO: Remove unwrap?
1185
- usize:: try_from ( max_disks) . unwrap ( ) ,
1183
+ max_disks,
1186
1184
diesel:: update ( disk:: dsl:: disk)
1187
1185
. set ( (
1188
1186
disk:: dsl:: disk_state. eq ( attached_label) ,
You can’t perform that action at this time.
0 commit comments