mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-09-01 01:38:19 +00:00
refactor: Use ReplicationFactor type in more places
- Remove the replication_factor.replication_factor() in favor of usize::from(replication_factor) to make the conversion more explicit. - Implement Display on ReplicationFactor so that it can be formatted without converting to usize - Use ReplicationFactor in the constructor of LayoutVersion and add a method to get a ReplicationFactor from a LayoutVersion, despite LayoutVersion still storing it as usize internally.
This commit is contained in:
@@ -68,7 +68,7 @@ impl SystemMetrics {
|
||||
let replication_factor = system.replication_factor;
|
||||
meter
|
||||
.u64_value_observer("garage_replication_factor", move |observer| {
|
||||
observer.observe(replication_factor.replication_factor() as u64, &[])
|
||||
observer.observe(usize::from(replication_factor) as u64, &[])
|
||||
})
|
||||
.with_description("Garage replication factor setting")
|
||||
.init()
|
||||
|
||||
Reference in New Issue
Block a user