Skip to content

Commit 8358ee7

Browse files
authored
Remove Future Sync bound from ServiceBuilder::boxed_clone_sync() (#851)
The function Future bounds are slightly too restrictive. Namely: ``` <L::Service as Service<R>>::Future: Send + Sync + 'static, ``` The `BoxCloneSyncService` and `BoxCloneSyncServiceLayer` require: ``` S::Future: Send + 'static, <L::Service as Service<T>>::Future: Send + 'static, ``` Removing the `Sync` bound from the helper function: - Makes the helper function more useful (where futures are not `Sync`) - Is backwards compatible (loosening trait bound)
1 parent 35188ec commit 8358ee7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tower/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
# Unreleased
9+
10+
### Changed
11+
12+
- **builder**: Remove Future Sync bound from ServiceBuilder::boxed_clone_sync() ([#851])
13+
814
# 0.5.3
915

1016
### Added

tower/src/builder/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ impl<L> ServiceBuilder<L> {
845845
where
846846
L: Layer<S> + Send + Sync + 'static,
847847
L::Service: Service<R> + Clone + Send + Sync + 'static,
848-
<L::Service as Service<R>>::Future: Send + Sync + 'static,
848+
<L::Service as Service<R>>::Future: Send + 'static,
849849
{
850850
let layer = self.into_inner();
851851

0 commit comments

Comments
 (0)