Skip to content

Commit a22dabd

Browse files
committed
fix(server): change Builder window size methods to be by-value
Closes #1814
1 parent b3774bd commit a22dabd

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

benches/end_to_end.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ fn spawn_server(rt: &mut Runtime, opts: &Opts) -> SocketAddr {
236236
let body = opts.response_body;
237237
let srv = Server::bind(&addr)
238238
.http2_only(opts.http2)
239-
.http2_initial_stream_window_size_(opts.http2_stream_window)
240-
.http2_initial_connection_window_size_(opts.http2_conn_window)
239+
.http2_initial_stream_window_size(opts.http2_stream_window)
240+
.http2_initial_connection_window_size(opts.http2_conn_window)
241241
.serve(make_service_fn( move |_| async move {
242242
Ok::<_, hyper::Error>(service_fn(move |req: Request<Body>| async move {
243243
let mut req_body = req.into_body();

src/server/mod.rs

+2-18
Original file line numberDiff line numberDiff line change
@@ -307,37 +307,21 @@ impl<I, E> Builder<I, E> {
307307
self
308308
}
309309

310-
// soft-deprecated? deprecation warning just seems annoying...
311-
// reimplemented to take `self` instead of `&mut self`
312-
#[doc(hidden)]
313-
pub fn http2_initial_stream_window_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self {
314-
self.protocol.http2_initial_stream_window_size(sz.into());
315-
self
316-
}
317-
318-
// soft-deprecated? deprecation warning just seems annoying...
319-
// reimplemented to take `self` instead of `&mut self`
320-
#[doc(hidden)]
321-
pub fn http2_initial_connection_window_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self {
322-
self.protocol.http2_initial_connection_window_size(sz.into());
323-
self
324-
}
325-
326310
/// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`][spec] option for HTTP2
327311
/// stream-level flow control.
328312
///
329313
/// Default is 65,535
330314
///
331315
/// [spec]: https://http2.github.io/http2-spec/#SETTINGS_INITIAL_WINDOW_SIZE
332-
pub fn http2_initial_stream_window_size_(mut self, sz: impl Into<Option<u32>>) -> Self {
316+
pub fn http2_initial_stream_window_size(mut self, sz: impl Into<Option<u32>>) -> Self {
333317
self.protocol.http2_initial_stream_window_size(sz.into());
334318
self
335319
}
336320

337321
/// Sets the max connection-level flow control for HTTP2
338322
///
339323
/// Default is 65,535
340-
pub fn http2_initial_connection_window_size_(mut self, sz: impl Into<Option<u32>>) -> Self {
324+
pub fn http2_initial_connection_window_size(mut self, sz: impl Into<Option<u32>>) -> Self {
341325
self.protocol.http2_initial_connection_window_size(sz.into());
342326
self
343327
}

0 commit comments

Comments
 (0)