diff --git a/examples/src/blocking/client.rs b/examples/src/blocking/client.rs index 5493594..5326e19 100644 --- a/examples/src/blocking/client.rs +++ b/examples/src/blocking/client.rs @@ -9,12 +9,13 @@ use hello_world::{greeter_client::GreeterClient, HelloReply, HelloRequest}; type StdError = Box; type Result = ::std::result::Result; -// The order of the fields in this struct is important. The runtime must be the first field and the -// client must be the last field so that when `BlockingClient` is dropped the client is dropped +// The order of the fields in this struct is important. They must be ordered +// such that when `BlockingClient` is dropped the client is dropped // before the runtime. Not doing this will result in a deadlock when dropped. +// Rust drops struct fields in declaration order. struct BlockingClient { - rt: Runtime, client: GreeterClient, + rt: Runtime, } impl BlockingClient {