lapin stats #493
Merged
lapin stats #493
Conversation
Server::http(addr)?.handle(move |_: Request, res: Response| { | ||
res.send(metrics.prometheus_output().as_bytes()).unwrap(); | ||
})?; | ||
Ok::<_, Box<dyn Error + Sync + Send + '_>>(()) |
cole-h
May 21, 2020
Member
This annotation is pretty gnarly. I also saw this in the Packet exporter (https://github.com/NixOS/ofborg/pull/489/files#diff-02fbe59114407226c4d138e271cd71a5R76) -- maybe this could be a type alias? I don't know if something like type Error = Box<dyn std::error::Error + Sync + Send + '_>;
is possible, but it looks nicer.
However, not a blocker. Do what you see fit.
This annotation is pretty gnarly. I also saw this in the Packet exporter (https://github.com/NixOS/ofborg/pull/489/files#diff-02fbe59114407226c4d138e271cd71a5R76) -- maybe this could be a type alias? I don't know if something like type Error = Box<dyn std::error::Error + Sync + Send + '_>;
is possible, but it looks nicer.
However, not a blocker. Do what you see fit.
LnL7
May 22, 2020
Author
Member
I don't think you can for the lifetime, since that's context based. But it BoxError<'_>
should work with type BoxError<'a> = Box<dyn Error + Sync Send + 'a>;
I don't think you can for the lifetime, since that's context based. But it BoxError<'_>
should work with type BoxError<'a> = Box<dyn Error + Sync Send + 'a>;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
No description provided.