@@ -23,7 +23,7 @@ pub const Pool = struct {
23
23
const loggers = try allocator .alloc (* Kv , size );
24
24
25
25
for (0.. size ) | i | {
26
- var kv = try allocator .create (Kv );
26
+ const kv = try allocator .create (Kv );
27
27
kv .* = try Kv .init (allocator , config );
28
28
loggers [i ] = kv ;
29
29
}
@@ -57,7 +57,7 @@ pub const Pool = struct {
57
57
self .mutex .unlock ();
58
58
const allocator = self .allocator ;
59
59
60
- var kv = allocator .create (Kv ) catch | e | {
60
+ const kv = allocator .create (Kv ) catch | e | {
61
61
logDynamicAllocationFailure (e );
62
62
return null ;
63
63
};
@@ -226,16 +226,16 @@ test "pool: acquire and release" {
226
226
var p = try Pool .init (t .allocator , min_config );
227
227
defer p .deinit ();
228
228
229
- var l1a = p .acquire () orelse unreachable ;
230
- var l2a = p .acquire () orelse unreachable ;
231
- var l3a = p .acquire () orelse unreachable ; // this should be dynamically generated
229
+ const l1a = p .acquire () orelse unreachable ;
230
+ const l2a = p .acquire () orelse unreachable ;
231
+ const l3a = p .acquire () orelse unreachable ; // this should be dynamically generated
232
232
233
233
try t .expectEqual (false , l1a == l2a );
234
234
try t .expectEqual (false , l2a == l3a );
235
235
236
236
p .release (l1a );
237
237
238
- var l1b = p .acquire () orelse unreachable ;
238
+ const l1b = p .acquire () orelse unreachable ;
239
239
try t .expectEqual (true , l1a == l1b );
240
240
241
241
p .release (l3a );
@@ -455,7 +455,7 @@ test "pool: logger" {
455
455
}
456
456
457
457
test "pool: loggerL" {
458
- var min_config = Config {.pool_size = 1 , .max_size = 100 };
458
+ const min_config = Config {.pool_size = 1 , .max_size = 100 };
459
459
var out = std .ArrayList (u8 ).init (t .allocator );
460
460
defer out .deinit ();
461
461
0 commit comments