From 8e401f03683b8f2cbce161be669cbd85c791e798 Mon Sep 17 00:00:00 2001 From: Erk- Date: Thu, 27 Sep 2018 18:42:08 +0200 Subject: Change DOS line endings to UNIX line endings --- src/cache/settings.rs | 100 +++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'src/cache') diff --git a/src/cache/settings.rs b/src/cache/settings.rs index e8e456b..51bff4c 100644 --- a/src/cache/settings.rs +++ b/src/cache/settings.rs @@ -1,50 +1,50 @@ -/// Settings for the cache. -/// -/// # Examples -/// -/// Create new settings, specifying the maximum number of messages: -/// -/// ```rust -/// use serenity::cache::Settings as CacheSettings; -/// -/// let mut settings = CacheSettings::new(); -/// settings.max_messages(10); -/// ``` -#[derive(Clone, Debug, Default)] -pub struct Settings { - /// The maximum number of messages to store in a channel's message cache. - /// - /// Defaults to 0. - pub max_messages: usize, - __nonexhaustive: (), -} - -impl Settings { - /// Creates new settings to be used with a cache. - #[inline] - pub fn new() -> Self { - Self::default() - } - - /// Sets the maximum number of messages to cache in a channel. - /// - /// Refer to [`max_messages`] for more information. - /// - /// # Examples - /// - /// Set the maximum number of messages to cache: - /// - /// ```rust - /// use serenity::cache::Settings; - /// - /// let mut settings = Settings::new(); - /// settings.max_messages(10); - /// ``` - /// - /// [`max_messages`]: #structfield.max_messages - pub fn max_messages(&mut self, max: usize) -> &mut Self { - self.max_messages = max; - - self - } -} +/// Settings for the cache. +/// +/// # Examples +/// +/// Create new settings, specifying the maximum number of messages: +/// +/// ```rust +/// use serenity::cache::Settings as CacheSettings; +/// +/// let mut settings = CacheSettings::new(); +/// settings.max_messages(10); +/// ``` +#[derive(Clone, Debug, Default)] +pub struct Settings { + /// The maximum number of messages to store in a channel's message cache. + /// + /// Defaults to 0. + pub max_messages: usize, + __nonexhaustive: (), +} + +impl Settings { + /// Creates new settings to be used with a cache. + #[inline] + pub fn new() -> Self { + Self::default() + } + + /// Sets the maximum number of messages to cache in a channel. + /// + /// Refer to [`max_messages`] for more information. + /// + /// # Examples + /// + /// Set the maximum number of messages to cache: + /// + /// ```rust + /// use serenity::cache::Settings; + /// + /// let mut settings = Settings::new(); + /// settings.max_messages(10); + /// ``` + /// + /// [`max_messages`]: #structfield.max_messages + pub fn max_messages(&mut self, max: usize) -> &mut Self { + self.max_messages = max; + + self + } +} -- cgit v1.2.3