|
12 | 12 | //! ## What you write
|
13 | 13 | //!
|
14 | 14 | //! ```rust
|
| 15 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
15 | 16 | //! #[macro_use]
|
16 | 17 | //! extern crate derive_builder;
|
17 | 18 | //!
|
|
25 | 26 | //!
|
26 | 27 | //! ## What you get
|
27 | 28 | //!
|
| 29 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 30 | +//! |
28 | 31 | //! ```rust
|
| 32 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
29 | 33 | //! # #[macro_use]
|
30 | 34 | //! # extern crate derive_builder;
|
31 | 35 | //! #
|
|
71 | 75 | //!
|
72 | 76 | //! Let's look again at the example above. You can now build structs like this:
|
73 | 77 | //!
|
| 78 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 79 | +//! |
74 | 80 | //! ```rust
|
| 81 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
75 | 82 | //! # #[macro_use] extern crate derive_builder;
|
76 | 83 | //! # #[derive(Builder)] struct Lorem { ipsum: u32 }
|
77 | 84 | //! # fn try_main() -> Result<(), String> {
|
|
84 | 91 | //!
|
85 | 92 | //! So let's make this call conditional
|
86 | 93 | //!
|
| 94 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 95 | +//! |
87 | 96 | //! ```rust
|
| 97 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
88 | 98 | //! # #[macro_use] extern crate derive_builder;
|
89 | 99 | //! # #[derive(Builder)] struct Lorem { ipsum: u32 }
|
90 | 100 | //! # fn try_main() -> Result<(), String> {
|
|
157 | 167 | //!
|
158 | 168 | //! The types of skipped fields must implement `Default`.
|
159 | 169 | //!
|
| 170 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 171 | +//! |
160 | 172 | //! ```rust
|
| 173 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
161 | 174 | //! # #[macro_use]
|
162 | 175 | //! # extern crate derive_builder;
|
163 | 176 | //! #
|
|
200 | 213 | //! You can make each setter generic over the `Into`-trait. It's as simple as adding
|
201 | 214 | //! `#[builder(setter(into))]` to either a field or the whole struct.
|
202 | 215 | //!
|
| 216 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 217 | +//! |
203 | 218 | //! ```rust
|
| 219 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
204 | 220 | //! # #[macro_use]
|
205 | 221 | //! # extern crate derive_builder;
|
206 | 222 | //! #
|
|
231 | 247 | //! You can only declare the `try_setter` attribute today if you're targeting nightly, and you have
|
232 | 248 | //! to add `#![feature(try_from)]` to your crate to use it.
|
233 | 249 | //!
|
| 250 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 251 | +//! |
234 | 252 | //! ```rust
|
| 253 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
235 | 254 | //! // #![feature(try_from)]
|
236 | 255 | //! # #![cfg_attr(feature = "nightlytests", feature(try_from))]
|
237 | 256 | //! # #[cfg(feature = "nightlytests")]
|
|
279 | 298 | //!
|
280 | 299 | //! The expression will be evaluated with each call to `build`.
|
281 | 300 | //!
|
| 301 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 302 | +//! |
282 | 303 | //! ```rust
|
| 304 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
283 | 305 | //! # #[macro_use]
|
284 | 306 | //! # extern crate derive_builder;
|
285 | 307 | //! #
|
|
310 | 332 | //!
|
311 | 333 | //! [`Default`]: https://doc.rust-lang.org/std/default/trait.Default.html
|
312 | 334 | //!
|
| 335 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 336 | +//! |
313 | 337 | //! ```rust
|
| 338 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
314 | 339 | //! # #[macro_use]
|
315 | 340 | //! # extern crate derive_builder;
|
316 | 341 | //! #
|
|
351 | 376 | //!
|
352 | 377 | //! ## Generic Structs
|
353 | 378 | //!
|
| 379 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 380 | +//! |
354 | 381 | //! ```rust
|
| 382 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
355 | 383 | //! # #[macro_use]
|
356 | 384 | //! # extern crate derive_builder;
|
357 | 385 | //! #
|
|
380 | 408 | //! The whitelisting minimizes interference with other custom attributes like
|
381 | 409 | //! those used by Serde, Diesel, or others.
|
382 | 410 | //!
|
| 411 | +//! <!-- this comment is a workaround for https://github.com/rust-lang/rust/issues/41401 --> |
| 412 | +//! |
383 | 413 | //! ```rust
|
| 414 | +//! # #![cfg_attr(feature = "nightlytests", feature(try_from))] |
384 | 415 | //! # #[macro_use]
|
385 | 416 | //! # extern crate derive_builder;
|
386 | 417 | //! #
|
|
0 commit comments