diff options
author | François Laignel <fengalin@free.fr> | 2022-10-12 13:35:20 +0300 |
---|---|---|
committer | François Laignel <fengalin@free.fr> | 2022-10-12 13:35:20 +0300 |
commit | 2bffdec691c441c9effefa4f27f72d64681c0bf2 (patch) | |
tree | a5f1058c6a4a52f1c94f808f5a42f6933d336a18 /generic/sodium/src/encrypter/imp.rs | |
parent | bc5b51687dacd2a1e4dadae8c4426a253a825ddf (diff) |
ts: better use of `imp` & `elem` args in `Pad{Sink,Src}Handler`s
This is a follow-up to commit 7ee4afac.
This commit cleans up the `Pad{Sink,Src}Handler` by
- Keeping arguments which are strictly necessary.
- Passing arguments by value for the trait functions which return
a `Future`. The arguments which were previously passed by reference
were `clone`d internally and then `clone`d again in most
implementations.
There are unfortunate differences in trait function signatures
between those which return a `Future` and the sync functions. This
is due to the requirement for the arguments to be moved to the
resulting `Future`, whereas sync functions can rely on references.
One particular notable difference is the use of the `imp` in sync
functions instead of the `elem` in functions returning a `Future`.
Because the `imp` is not guaranteed to implement `Clone`, we can't
move it to the resulting `Future`, so the `elem` is used.
Diffstat (limited to 'generic/sodium/src/encrypter/imp.rs')
0 files changed, 0 insertions, 0 deletions