Repository: seanmonstar/warp (language: rust)

Issue:
wrap_fn documentation/example
`wrap_fn` is only very lightly documented. I would like to use it, but it's difficult to figure out how. It would be great if the documentation or examples had a simple example of how to use it.
wrap_fn documentation/example
`wrap_fn` is only very lightly documented. I would like to use it, but it's difficult to figure out how. It would be great if the documentation or examples had a simple example of how to use it.


Discussion / hints:
Oh, I somehow missed https://github.com/seanmonstar/warp/blob/master/examples/wrapping.rs, oops! Could a link to that be added to the rustdoc for wrap_fn?
Hi, want to submit a PR with it?
Oh, I somehow missed https://github.com/seanmonstar/warp/blob/master/examples/wrapping.rs, oops! Could a link to that be added to the rustdoc for wrap_fn?
Hi, want to submit a PR with it?

Fix patch:
diff --git a/src/filter/wrap.rs b/src/filter/wrap.rs
index 377b0ef0e..faceb705f 100644
--- a/src/filter/wrap.rs
+++ b/src/filter/wrap.rs
@@ -26,7 +26,19 @@ where
 {
 }
 
-/// Function that receives a filter to be combined with pre and after filters
+/// Combines received filter with pre and after filters
+///
+/// # Example
+///
+/// ```
+/// use crate::warp::Filter;
+///
+/// let route = warp::any()
+///     .map(|| "hello world")
+///     .with(warp::wrap_fn(|filter| filter));
+/// ```
+///
+/// You can find the full example in the [usage example](https://github.com/seanmonstar/warp/blob/master/examples/wrapping.rs).
 pub fn wrap_fn<F, T, U>(func: F) -> WrapFn<F>
 where
     F: Fn(T) -> U,


Test patch: