mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 20:48:55 +00:00
base: fix clippy::multiple_bound_locations lint
Merge the `where` clause bounds into the ones in the generic type definitions. This is also more consistent with the other functions in this file. BUG=b:344974550 TEST=tools/clippy Change-Id: Ie4d33ae0c204dab6279607aa0b181768b42c75eb Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599145 Reviewed-by: Elie Kheirallah <khei@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
df6fc83b25
commit
75a3c8ab2e
1 changed files with 2 additions and 6 deletions
|
@ -19,14 +19,10 @@ use sync::Mutex;
|
|||
/// NOTE: This does not validate already serialized Mutexes and data. If multiple structs contain a
|
||||
/// clone of the Arc, and they are all being serialized, this will result in the same data being
|
||||
/// serialized, once per clone.
|
||||
pub fn serialize_arc_mutex<S, T: ?Sized>(
|
||||
pub fn serialize_arc_mutex<S: Serializer, T: Serialize + ?Sized>(
|
||||
item: &Arc<Mutex<T>>,
|
||||
serializer: S,
|
||||
) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
T: Serialize,
|
||||
{
|
||||
) -> Result<S::Ok, S::Error> {
|
||||
let lock = item.lock();
|
||||
serde::Serialize::serialize(&*lock, serializer)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue