@@ -145,7 +145,7 @@ impl TestContext {
145145 /// Sends a request to the ephemeral server and returns a [`ResponseFuture`].
146146 ///
147147 /// ## Example
148- /// ```rust, no_run
148+ /// ```no_run
149149 /// # use charted_testkit::TestContext;
150150 /// # use axum::{routing, http::Method, body::Bytes};
151151 /// #
@@ -159,7 +159,7 @@ impl TestContext {
159159 /// ctx.serve(axum::Router::new().route("/", routing::get(handler))).await;
160160 ///
161161 /// let res = ctx
162- /// .request::<_, Bytes, _> ("/", Method::GET, None, |_| {} )
162+ /// .request("/", Method::GET, None, charted_testkit::noop_request )
163163 /// .await
164164 /// .expect("was unable to send request to ephermeral server");
165165 ///
@@ -265,6 +265,11 @@ impl TestContext {
265265 }
266266}
267267
268+ /// A empty function that can be used with [`TestContext::request`].
269+ pub fn noop_request ( _: & mut Request < Full < Bytes > > ) {
270+ // should be empty.
271+ }
272+
268273// Private APIs used by macros; do not use!
269274#[ doc( hidden) ]
270275pub mod __private {
@@ -296,7 +301,7 @@ mod tests {
296301 ctx. serve ( router ( ) ) . await ;
297302
298303 let res = ctx
299- . request ( "/" , Method :: GET , None , |_| { } )
304+ . request ( "/" , Method :: GET , None , super :: noop_request )
300305 . await
301306 . expect ( "unable to send request" ) ;
302307
0 commit comments