mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-23 03:33:51 +01:00
Assuure Delegate is Send (#271)
This commit is contained in:
@@ -103,7 +103,7 @@ pub struct ServerMessage {
|
||||
///
|
||||
/// It contains methods to deal with all common issues, as well with the ones related to
|
||||
/// uploading media
|
||||
pub trait Delegate {
|
||||
pub trait Delegate: Send {
|
||||
/// Called at the beginning of any API request. The delegate should store the method
|
||||
/// information if he is interesting in knowing more context when further calls to it
|
||||
/// are made.
|
||||
|
||||
@@ -97,6 +97,15 @@ bar\r\n\
|
||||
Ok(Chunk { first: 2, last: 42 })
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dyn_delegate_is_send() {
|
||||
fn with_send(x: impl Send) {}
|
||||
|
||||
let mut dd = DefaultDelegate::default();
|
||||
let dlg: &mut dyn Delegate = &mut dd;
|
||||
with_send(dlg);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user