From 5419e4256934a5a3263f4660b886ee04eeed0065 Mon Sep 17 00:00:00 2001 From: Matt Klein Date: Mon, 13 Jun 2022 12:25:11 -0600 Subject: [PATCH] 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 --- tower/src/load_shed/error.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tower/src/load_shed/error.rs b/tower/src/load_shed/error.rs index ef401f08f..3a4c025b4 100644 --- a/tower/src/load_shed/error.rs +++ b/tower/src/load_shed/error.rs @@ -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: () } } }