We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 269c96a commit 08aedcaCopy full SHA for 08aedca
1 file changed
protobuf/src/core.rs
@@ -213,6 +213,21 @@ pub fn message_down_cast<'a, M: Message + 'a>(m: &'a Message) -> &'a M {
213
m.as_any().downcast_ref::<M>().unwrap()
214
}
215
216
+impl Clone for Box<dyn Message> {
217
+ fn clone(&self) -> Self {
218
+ use std::ops::Deref;
219
+ self.descriptor().clone(self.deref())
220
+ }
221
+}
222
+
223
+#[cfg(off)] // don't need it
224
+impl PartialEq for Box<Message> {
225
+ fn eq(&self, other: &Box<Message>) -> bool {
226
227
+ self.descriptor() == other.descriptor() && self.descriptor().eq(self.deref(), other.deref())
228
229
230
231
/// Parse message from stream.
232
pub fn parse_from<M: Message>(is: &mut CodedInputStream) -> ProtobufResult<M> {
233
let mut r: M = Message::new();
0 commit comments