load_shed: make constructor for Overloaded error public (#661)

This allows for mocking. This also matches what is done for
the timeout Elapsed error.

Signed-off-by: Matt Klein <mklein@lyft.com>
This commit is contained in:
Matt Klein 2022-06-13 12:25:11 -06:00 committed by GitHub
parent 8b522920f8
commit 3c170aaf19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,12 +7,14 @@ use std::fmt;
/// called.
///
/// [`LoadShed`]: crate::load_shed::LoadShed
#[derive(Default)]
pub struct Overloaded {
_p: (),
}
impl Overloaded {
pub(crate) fn new() -> Self {
/// Construct a new overloaded error
pub fn new() -> Self {
Overloaded { _p: () }
}
}