Repository: bevyengine/bevy
File: crates/bevy_winit/src/winit_config.rs (Rust)

Code before:
    ///
    /// [`Reactive`](UpdateMode::Reactive) if windows have focus,
    /// [`reactive_low_power`](UpdateMode::reactive_low_power) otherwise.
    ///
    /// Use the [`EventLoopProxy`](crate::EventLoopProxy) to request a redraw from outside bevy.
    pub fn desktop_app() -> Self {
        WinitSettings {
            focused_mode: UpdateMode::reactive(Duration::from_secs(5)),
            unfocused_mode: UpdateMode::reactive_low_power(Duration::from_secs(60)),
        }
    }

    /// Default settings for mobile.
    ///
    /// [`Reactive`](UpdateMode::Reactive) if windows have focus,
    /// [`reactive_low_power`](UpdateMode::reactive_low_power) otherwise.
    ///
    /// Use the [`EventLoopProxy`](crate::EventLoopProxy) to request a redraw from outside bevy.
    pub fn mobile() -> Self {
        WinitSettings {
            focused_mode: UpdateMode::reactive(Duration::from_secs_f32(1.0 / 60.0)),
            unfocused_mode: UpdateMode::reactive_low_power(Duration::from_secs(1)),
        }
    }

    /// Default settings for stress tests, the application will update as fast possible.
    ///
    /// Uses [`Continuous`](UpdateMode::Continuous) regardless of whether windows have focus.
    pub fn continuous() -> Self {
        WinitSettings {
            focused_mode: UpdateMode::Continuous,
            unfocused_mode: UpdateMode::Continuous,
        }
    }

    /// Returns the current [`UpdateMode`].
    ///
    /// **Note:** The output depends on whether the window has focus or not.
    pub fn update_mode(&self, focused: bool) -> UpdateMode {
        match focused {
            true => self.focused_mode,
            false => self.unfocused_mode,
        }
    }
}

impl Default for WinitSettings {
    fn default() -> Self {
        WinitSettings::game()
    }
}

Review comment (suggestion):
```suggestion
    /// The application will update as fast possible.
```

I don't think it's a good idea to surface this to normal readers of the API docs. 


Code after:
    ///
    /// [`Reactive`](UpdateMode::Reactive) if windows have focus,
    /// [`reactive_low_power`](UpdateMode::reactive_low_power) otherwise.
    ///
    /// Use the [`EventLoopProxy`](crate::EventLoopProxy) to request a redraw from outside bevy.
    pub fn desktop_app() -> Self {
        WinitSettings {
            focused_mode: UpdateMode::reactive(Duration::from_secs(5)),
            unfocused_mode: UpdateMode::reactive_low_power(Duration::from_secs(60)),
        }
    }

    /// Default settings for mobile.
    ///
    /// [`Reactive`](UpdateMode::Reactive) if windows have focus,
    /// [`reactive_low_power`](UpdateMode::reactive_low_power) otherwise.
    ///
    /// Use the [`EventLoopProxy`](crate::EventLoopProxy) to request a redraw from outside bevy.
    pub fn mobile() -> Self {
        WinitSettings {
            focused_mode: UpdateMode::reactive(Duration::from_secs_f32(1.0 / 60.0)),
            unfocused_mode: UpdateMode::reactive_low_power(Duration::from_secs(1)),
        }
    }

    /// The application will update as fast possible.
    ///
    /// Uses [`Continuous`](UpdateMode::Continuous) regardless of whether windows have focus.
    pub fn continuous() -> Self {
        WinitSettings {
            focused_mode: UpdateMode::Continuous,
            unfocused_mode: UpdateMode::Continuous,
        }
    }

    /// Returns the current [`UpdateMode`].
    ///
    /// **Note:** The output depends on whether the window has focus or not.
    pub fn update_mode(&self, focused: bool) -> UpdateMode {
        match focused {
            true => self.focused_mode,
            false => self.unfocused_mode,
        }
    }
}

impl Default for WinitSettings {
    fn default() -> Self {
        WinitSettings::game()
    }
}