Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lapin stats #493

Merged
merged 1 commit into from May 23, 2020
Merged

lapin stats #493

merged 1 commit into from May 23, 2020

Conversation

@LnL7
Copy link
Member

LnL7 commented May 21, 2020

No description provided.

@cole-h
cole-h approved these changes May 21, 2020
Server::http(addr)?.handle(move |_: Request, res: Response| {
res.send(metrics.prometheus_output().as_bytes()).unwrap();
})?;
Ok::<_, Box<dyn Error + Sync + Send + '_>>(())

This comment has been minimized.

Copy link
@cole-h

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 comment has been minimized.

Copy link
@LnL7

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>;

@LnL7 LnL7 merged commit 2dc4868 into NixOS:released May 23, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@LnL7 LnL7 deleted the LnL7:lapin-stats branch May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.