fix: remove compilation error

mem-usage
Jef Roosens 2022-12-30 09:55:39 +01:00
parent a744c02df4
commit 23d384989e
2 changed files with 5 additions and 4 deletions

View File

@ -1 +0,0 @@
module metrics

View File

@ -7,7 +7,7 @@ import arrays
pub struct PrometheusExporter { pub struct PrometheusExporter {
buckets []f64 buckets []f64
mut: mut:
collector MetricsCollector collector &MetricsCollector = unsafe { nil }
} }
pub fn new_prometheus_exporter(buckets []f64) PrometheusExporter { pub fn new_prometheus_exporter(buckets []f64) PrometheusExporter {
@ -16,9 +16,11 @@ pub fn new_prometheus_exporter(buckets []f64) PrometheusExporter {
} }
} }
pub fn (mut e PrometheusExporter) load(collector MetricsCollector) { pub fn (mut e PrometheusExporter) load(collector &MetricsCollector) {
unsafe {
e.collector = collector e.collector = collector
} }
}
pub fn (mut e PrometheusExporter) export_to_string() !string { pub fn (mut e PrometheusExporter) export_to_string() !string {
mut builder := strings.new_builder(64) mut builder := strings.new_builder(64)