File tree 1 file changed +18
-4
lines changed
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 206
206
//!
207
207
//!
208
208
//! ```
209
+ //! use std::fmt;
210
+ //!
209
211
//! use once_cell::sync::OnceCell;
210
212
//!
211
213
//! #[derive(Debug)]
228
230
//! }
229
231
//! }
230
232
//!
231
- //! #[derive(Default, Debug )]
233
+ //! #[derive(Default)]
232
234
//! struct A<'a> {
233
235
//! b: LateInit<&'a B<'a>>,
234
236
//! }
235
237
//!
236
- //! #[derive(Default, Debug )]
238
+ //! #[derive(Default)]
237
239
//! struct B<'a> {
238
240
//! a: LateInit<&'a A<'a>>
239
241
//! }
240
242
//!
243
+ //! impl fmt::Debug for A<'_> {
244
+ //! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
245
+ //! write!(f, "A")
246
+ //! }
247
+ //! }
248
+ //!
249
+ //! impl fmt::Debug for B<'_> {
250
+ //! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
251
+ //! write!(f, "B")
252
+ //! }
253
+ //! }
254
+ //!
241
255
//! fn build_cycle() {
242
256
//! let a = A::default();
243
257
//! let b = B::default();
314
328
//! **Does this crate support async?**
315
329
//!
316
330
//! No, but you can use [`async_once_cell`](https://crates.io/crates/async_once_cell) instead.
317
- //!
331
+ //!
318
332
//! **Can I bring my own mutex?**
319
- //!
333
+ //!
320
334
//! There is [generic_once_cell](https://crates.io/crates/generic_once_cell) to allow just that.
321
335
//!
322
336
//! # Related crates
You can’t perform that action at this time.
0 commit comments