Skip to content

Commit

Permalink
load_shed: make constructor for Overloaded error public (#661)
Browse files Browse the repository at this point in the history
This allows for mocking. This also matches what is done for
the timeout Elapsed error.

Signed-off-by: Matt Klein <mklein@lyft.com>
  • Loading branch information
mattklein123 authored and hawkw committed Jun 17, 2022
1 parent 697b8d0 commit 5419e42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tower/src/load_shed/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: () }
}
}
Expand Down

0 comments on commit 5419e42

Please sign in to comment.