-
-
Notifications
You must be signed in to change notification settings - Fork 339
Description
Over in non-binary/http-cache-semantics#2, we're using request::Parts
and response::Parts
rather than Request
or Response
because we never care about the bodies. But the builders are still the easiest way to construct those.
So it'd be nice to be able to take a builder and say .parts().unwrap()
instead of .body(()).unwrap().into_parts().0
. Our callers will likely have full requests and responses so they won't care, this is just nice for situations like our unit tests where we really only need to build the non-body parts.
I think this means adding new methods to the builders along the lines of pub fn parts(self) -> Result<Parts<T>> { self.inner }
.
Thoughts?
By the way, thanks for changing the builders to by-value instead of by-reference; that turned out to simplify our code by a lot.