]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/doc: restore comment with code example, but ignore 8879/head
authorJason Ish <jason.ish@oisf.net>
Fri, 12 May 2023 14:59:54 +0000 (08:59 -0600)
committerVictor Julien <vjulien@oisf.net>
Fri, 12 May 2023 17:53:36 +0000 (19:53 +0200)
Use backticks for proper markdown processing. As Rust code in
backticks is compiled, and this is a non-complete example, tag the
code sample to be ignored.

rust/src/applayer.rs

index 3f33c5f9d861832b28e282682c73ed87b6a052f9..75e507de59af7bed3b79e81c7d732ebcf294b480 100644 (file)
@@ -588,20 +588,21 @@ pub trait AppLayerEvent {
     ) -> i8;
 }
 
-//
-// Normally usage of this function will be generated by
-// derive(AppLayerEvent), for example:
-//
-// #[derive(AppLayerEvent)]
-// enum AppEvent {
-//     EventOne,
-//     EventTwo,
-// }
-//
-// get_event_info::<AppEvent>(...)
-
 /// Generic `get_info_info` implementation for enums implementing
 /// AppLayerEvent.
+///
+/// Normally usage of this function will be generated by
+/// derive(AppLayerEvent), for example:
+///
+/// ```rust,ignore
+/// #[derive(AppLayerEvent)]
+/// enum AppEvent {
+///     EventOne,
+///     EventTwo,
+/// }
+///
+/// get_event_info::<AppEvent>(...)
+/// ```
 #[inline(always)]
 pub unsafe fn get_event_info<T: AppLayerEvent>(
     event_name: *const std::os::raw::c_char,