summary refs log tree commit diff
path: root/msg_socket
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-03-09 00:34:15 +0000
committerAlyssa Ross <hi@alyssa.is>2020-03-10 18:02:55 +0000
commit951c0833e002f37203a466054d397d3831b3e4e5 (patch)
tree13d5f6283a2dd4c384158a37a3f3e27e316475cd /msg_socket
parentb277139958518c6f13961a0b914c650faf94f01e (diff)
downloadcrosvm-951c0833e002f37203a466054d397d3831b3e4e5.tar
crosvm-951c0833e002f37203a466054d397d3831b3e4e5.tar.gz
crosvm-951c0833e002f37203a466054d397d3831b3e4e5.tar.bz2
crosvm-951c0833e002f37203a466054d397d3831b3e4e5.tar.lz
crosvm-951c0833e002f37203a466054d397d3831b3e4e5.tar.xz
crosvm-951c0833e002f37203a466054d397d3831b3e4e5.tar.zst
crosvm-951c0833e002f37203a466054d397d3831b3e4e5.zip
msg_socket: SocketMsg -> MsgSocket
I suspect this is an old name that had stuck around.  The internal
functions being named socket_msg_* didn't really matter, but the
"derive(SocketMsg)" error message was confusing.
Diffstat (limited to 'msg_socket')
-rw-r--r--msg_socket/msg_on_socket_derive/msg_on_socket_derive.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/msg_socket/msg_on_socket_derive/msg_on_socket_derive.rs b/msg_socket/msg_on_socket_derive/msg_on_socket_derive.rs
index 3779357..a7988c6 100644
--- a/msg_socket/msg_on_socket_derive/msg_on_socket_derive.rs
+++ b/msg_socket/msg_on_socket_derive/msg_on_socket_derive.rs
@@ -15,14 +15,14 @@ use syn::{parse_macro_input, Data, DataEnum, DataStruct, DeriveInput, Fields, Id
 #[proc_macro_derive(MsgOnSocket)]
 pub fn msg_on_socket_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
     let input = parse_macro_input!(input as DeriveInput);
-    let impl_for_input = socket_msg_impl(input);
+    let impl_for_input = msg_socket_impl(input);
     impl_for_input.into()
 }
 
-fn socket_msg_impl(input: DeriveInput) -> TokenStream {
+fn msg_socket_impl(input: DeriveInput) -> TokenStream {
     if !input.generics.params.is_empty() {
         return quote! {
-            compile_error!("derive(SocketMsg) does not support generic parameters");
+            compile_error!("derive(MsgSocket) does not support generic parameters");
         };
     }
     match input.data {
@@ -35,7 +35,7 @@ fn socket_msg_impl(input: DeriveInput) -> TokenStream {
         }
         Data::Enum(de) => impl_for_enum(input.ident, de),
         _ => quote! {
-            compile_error!("derive(SocketMsg) only support struct and enum");
+            compile_error!("derive(MsgSocket) only support struct and enum");
         },
     }
 }
@@ -495,7 +495,7 @@ fn write_to_buffer_and_move_offset(name: &Ident, ty: &syn::Type) -> TokenStream
 
 #[cfg(test)]
 mod tests {
-    use crate::socket_msg_impl;
+    use crate::msg_socket_impl;
     use quote::quote;
     use syn::{parse_quote, DeriveInput};
 
@@ -565,7 +565,7 @@ mod tests {
             }
         };
 
-        assert_eq!(socket_msg_impl(input).to_string(), expected.to_string());
+        assert_eq!(msg_socket_impl(input).to_string(), expected.to_string());
     }
 
     #[test]
@@ -631,7 +631,7 @@ mod tests {
             }
         };
 
-        assert_eq!(socket_msg_impl(input).to_string(), expected.to_string());
+        assert_eq!(msg_socket_impl(input).to_string(), expected.to_string());
     }
 
     #[test]
@@ -742,6 +742,6 @@ mod tests {
 
         };
 
-        assert_eq!(socket_msg_impl(input).to_string(), expected.to_string());
+        assert_eq!(msg_socket_impl(input).to_string(), expected.to_string());
     }
 }