Last active
July 2, 2018 23:53
-
-
Save tobz/c0d3bff12d280b5755923876109e3846 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error[E0597]: `facade` does not live long enough | |
--> src/metrics/mod.rs:33:24 | |
| | |
33 | let facade2 = &facade; | |
| ^^^^^^ borrowed value does not live long enough | |
... | |
39 | }; | |
| - borrowed value only lives until here | |
| | |
= note: borrowed value must be valid for the static lifetime... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy_static! { | |
static ref METRICS: MetricsFacade = { | |
let receiver = Receiver::configure() | |
.build(); | |
let facade = MetricsFacade::new(&receiver); | |
let facade2 = &facade; | |
// Spawn our actual processing loop. | |
thread::spawn(move || run_metrics_loop(receiver, facade2)); | |
facade | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment