]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/issue-2759.rs
Auto merge of #84876 - alexcrichton:inline-thread-locals-cross-crate, r=Mark-Simulacrum
[rust.git] / src / tools / rustfmt / tests / target / issue-2759.rs
1 // rustfmt-wrap_comments: true
2 // rustfmt-max_width: 89
3
4 // Code block in doc comments that will exceed max width.
5 /// ```rust
6 /// extern crate actix_web;
7 /// use actix_web::{actix, server, App, HttpResponse};
8 ///
9 /// fn main() {
10 ///     // Run actix system, this method actually starts all async processes
11 ///     actix::System::run(|| {
12 ///         server::new(|| App::new().resource("/", |r| r.h(|_| HttpResponse::Ok())))
13 ///             .bind("127.0.0.1:0")
14 ///             .expect("Can not bind to 127.0.0.1:0")
15 ///             .start();
16 /// #           actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
17 ///     });
18 /// }
19 /// ```
20 fn foo() {}
21
22 // Code block in doc comments without the closing '```'.
23 /// ```rust
24 /// # extern crate actix_web;
25 /// use actix_web::{App, HttpResponse, http};
26 ///
27 /// fn main() {
28 ///     let app = App::new()
29 ///         .resource(
30 ///             "/", |r| r.method(http::Method::GET).f(|r| HttpResponse::Ok()))
31 ///         .finish();
32 /// }
33 fn bar() {}
34
35 // `#` with indent.
36 /// ```rust
37 /// # use std::thread;
38 /// # extern crate actix_web;
39 /// use actix_web::{server, App, HttpResponse};
40 ///
41 /// struct State1;
42 ///
43 /// struct State2;
44 ///
45 /// fn main() {
46 ///     # thread::spawn(|| {
47 ///     server::new(|| {
48 ///         vec![
49 ///             App::with_state(State1)
50 ///                 .prefix("/app1")
51 ///                 .resource("/", |r| r.f(|r| HttpResponse::Ok()))
52 ///                 .boxed(),
53 ///             App::with_state(State2)
54 ///                 .prefix("/app2")
55 ///                 .resource("/", |r| r.f(|r| HttpResponse::Ok()))
56 ///                 .boxed(),
57 ///         ]
58 ///     })
59 ///     .bind("127.0.0.1:8080")
60 ///     .unwrap()
61 ///     .run()
62 ///     # });
63 /// }
64 /// ```
65 fn foobar() {}