Skip to content

Commit d02624c

Browse files
committed
rust: add doc examples
1 parent 797f531 commit d02624c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

runtime/rust/src/main.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
use regex::Regex;
22
use tungstenite::{Message, connect};
33

4+
/// This is a doc comment.
5+
/// See https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html
6+
/// # Examples
7+
///
8+
/// ```
9+
/// /// This example can be tested with `rustdoc --test main.rs`
10+
/// # let baz = "baz" /// this line will be hidden from the docs
11+
/// let foo = "foo";
12+
/// assert_eq!(foo, "foo");
13+
/// ```
14+
15+
#[doc = r" This is a doc comment."]
16+
#[doc = include_str!("../README.md")]
17+
18+
/// bar docs
19+
mod bar {
20+
/// the docs for Bar
21+
pub struct Bar;
22+
}
23+
24+
/// This struct is not [Bar]
25+
pub struct Foo1;
26+
427
fn main() {
528
println!("Hello, world!");
629

0 commit comments

Comments
 (0)