ToOwned<Owned = D> -> D: Clone

This commit is contained in:
Temirkhan Myrzamadi 2021-03-28 16:30:12 +06:00
parent eac67af27a
commit 68135d004f
3 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Do not return a dialogue from `Storage::{remove_dialogue, update_dialogue}`.
- Require `D: ToOwned<Owned = D>` in `dialogues_repl` and `InMemStorage`.
- Require `D: Clone` in `dialogues_repl(_with_listener)` and `InMemStorage`.
### Fixed

View file

@ -27,7 +27,7 @@ impl<S> InMemStorage<S> {
impl<D> Storage<D> for InMemStorage<D>
where
D: ToOwned<Owned = D>,
D: Clone,
D: Send + 'static,
{
type Error = std::convert::Infallible;

View file

@ -26,7 +26,7 @@ use teloxide_core::{requests::Requester, types::Message};
pub async fn dialogues_repl<'a, R, H, D, Fut>(requester: R, handler: H)
where
H: Fn(UpdateWithCx<R, Message>, D) -> Fut + Send + Sync + 'static,
D: ToOwned<Owned = D> + Default + Send + 'static,
D: Clone + Default + Send + 'static,
Fut: Future<Output = DialogueStage<D>> + Send + 'static,
R: Requester + Send + Clone + 'static,
<R as Requester>::GetUpdatesFaultTolerant: Send,
@ -61,7 +61,7 @@ pub async fn dialogues_repl_with_listener<'a, R, H, D, Fut, L, ListenerE>(
listener: L,
) where
H: Fn(UpdateWithCx<R, Message>, D) -> Fut + Send + Sync + 'static,
D: ToOwned<Owned = D> + Default + Send + 'static,
D: Clone + Default + Send + 'static,
Fut: Future<Output = DialogueStage<D>> + Send + 'static,
L: UpdateListener<ListenerE> + Send + 'a,
ListenerE: Debug + Send + 'a,