Repository: tokio-rs/tokio
File: tokio/src/runtime/mod.rs (Rust)

Code before:
    /// The Tokio runtime implements `Sync` and `Send` to allow you to wrap it
    /// in a `Arc`. Most fn take `&self` to allow you to call them concurrently
    /// across multiple threads.
    ///
    /// Calls to `shutdown` and `shutdown_timeout` require exclusive ownership of
    /// the runtime type and this can be achieved via `Arc::try_unwrap` when only
    /// one strong count reference is left over.
    ///
    /// [timer]: crate::time
    /// [mod]: index.html
    /// [`new`]: method@Self::new
    /// [`Builder`]: struct@Builder
    #[derive(Debug)]
    pub struct Runtime {
        /// Task scheduler
        scheduler: Scheduler,

        /// Handle to runtime, also contains driver handles
        handle: Handle,

        /// Blocking pool handle, used to signal shutdown
        blocking_pool: BlockingPool,
    }

    /// The flavor of the `Runtime`.
    #[derive(Debug, PartialEq)]
    pub enum RuntimeFlavor {
        /// The flavor that executes all tasks on the current thread.
        CurrentThread,
        /// The flavor that executes tasks across multiple threads.
        MultiThread,
    }

    /// The runtime scheduler is either a multi-thread or a current-thread executor.
    #[derive(Debug)]
    enum Scheduler {
        /// Execute all tasks on the current-thread.
        CurrentThread(CurrentThread),

        /// Execute tasks across multiple threads.
        #[cfg(all(feature = "rt-multi-thread", not(tokio_wasi)))]
        MultiThread(MultiThread),
    }

    /// After thread starts / before thread stops
    type Callback = std::sync::Arc<dyn Fn() + Send + Sync>;

    impl Runtime {
        cfg_not_wasi! {
            /// Creates a new runtime instance with default configuration values.
            ///

Review comment (bug):
This isn't a floating point number.
```suggestion
    #[derive(Debug, PartialEq, Eq)]
```

Code after:
    /// The Tokio runtime implements `Sync` and `Send` to allow you to wrap it
    /// in a `Arc`. Most fn take `&self` to allow you to call them concurrently
    /// across multiple threads.
    ///
    /// Calls to `shutdown` and `shutdown_timeout` require exclusive ownership of
    /// the runtime type and this can be achieved via `Arc::try_unwrap` when only
    /// one strong count reference is left over.
    ///
    /// [timer]: crate::time
    /// [mod]: index.html
    /// [`new`]: method@Self::new
    /// [`Builder`]: struct@Builder
    #[derive(Debug)]
    pub struct Runtime {
        /// Task scheduler
        scheduler: Scheduler,

        /// Handle to runtime, also contains driver handles
        handle: Handle,

        /// Blocking pool handle, used to signal shutdown
        blocking_pool: BlockingPool,
    }

    /// The flavor of a `Runtime`.
    ///
    /// This is the return type for [`Handle::runtime_flavor`](crate::runtime::Handle::runtime_flavor()).
    #[derive(Debug, PartialEq, Eq)]
    #[non_exhaustive]
    pub enum RuntimeFlavor {
        /// The flavor that executes all tasks on the current thread.
        CurrentThread,
        /// The flavor that executes tasks across multiple threads.
        MultiThread,
    }

    /// The runtime scheduler is either a multi-thread or a current-thread executor.
    #[derive(Debug)]
    enum Scheduler {
        /// Execute all tasks on the current-thread.
        CurrentThread(CurrentThread),

        /// Execute tasks across multiple threads.
        #[cfg(all(feature = "rt-multi-thread", not(tokio_wasi)))]
        MultiThread(MultiThread),
    }

    /// After thread starts / before thread stops
    type Callback = std::sync::Arc<dyn Fn() + Send + Sync>;

    impl Runtime {