diff options
| author | Lakelezz <[email protected]> | 2018-11-19 22:17:08 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-11-19 22:17:08 +0100 |
| commit | 30b6d6ad9ac047c34569b5b430ccd5859d75cf45 (patch) | |
| tree | 7f5116845e458665bb5a4bbf836d1274547de314 /src/utils | |
| parent | Remove Rust release `1.25.0`. (diff) | |
| download | serenity-30b6d6ad9ac047c34569b5b430ccd5859d75cf45.tar.xz serenity-30b6d6ad9ac047c34569b5b430ccd5859d75cf45.zip | |
Remove everything marked `deprecated` since `v0.5.x` or older (#441)
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/colour.rs | 8 | ||||
| -rw-r--r-- | src/utils/mod.rs | 55 |
2 files changed, 0 insertions, 63 deletions
diff --git a/src/utils/colour.rs b/src/utils/colour.rs index a678a32..b877bcd 100644 --- a/src/utils/colour.rs +++ b/src/utils/colour.rs @@ -8,14 +8,6 @@ macro_rules! colour { #[$attr] pub const $constname: Colour = Colour($val); )* - - $( - #[$attr] - #[deprecated(note = "Use the constant instead", since = "0.5.5")] - pub fn $name() -> Colour { - Colour::new($val) - } - )* } } } diff --git a/src/utils/mod.rs b/src/utils/mod.rs index b2b4323..8b9c482 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -63,50 +63,6 @@ pub fn vecmap_to_json_map<K: PartialEq + ToString>(map: VecMap<K, Value>) -> Map json_map } -/// Determines if a name is NSFW. -/// -/// This checks that the name is either `"nsfw"` or, for names longer than that, -/// is prefixed with `"nsfw"`. -/// -/// # Examples -/// -/// Check that a channel named `"nsfw"` is in fact NSFW: -/// -/// ```rust -/// use serenity::utils; -/// -/// assert!(utils::is_nsfw("nsfw")); -/// ``` -/// -/// Check that a channel named `"cats"` is _not_ NSFW: -/// -/// ```rust -/// use serenity::utils; -/// -/// assert!(!utils::is_nsfw("cats")); -/// ``` -/// -/// Check that a channel named `"nsfw-stuff"` _is_ NSFW: -/// -/// ```rust -/// use serenity::utils; -/// -/// assert!(utils::is_nsfw("nsfw-stuff")); -/// ``` -/// -/// Channels prefixed with `"nsfw"` but not the hyphen (`'-'`) are _not_ -/// considered NSFW: -/// -/// ```rust -/// use serenity::utils; -/// -/// assert!(!utils::is_nsfw("nsfwstuff")); -/// ``` -#[deprecated(since = "0.5.10", note = "Discord no longer turns a channel NSFW based on its name.")] -pub fn is_nsfw(name: &str) -> bool { - name == "nsfw" || name.chars().count() > 5 && name.starts_with("nsfw-") -} - /// Retrieves the "code" part of an invite out of a URL. /// /// # Examples @@ -900,17 +856,6 @@ mod test { assert_eq!(parsed, ["a", "b c", "d", "e f", "g"]); } - #[allow(deprecated)] - #[test] - fn test_is_nsfw() { - assert!(!is_nsfw("general")); - assert!(is_nsfw("nsfw")); - assert!(is_nsfw("nsfw-test")); - assert!(!is_nsfw("nsfw-")); - assert!(!is_nsfw("général")); - assert!(is_nsfw("nsfw-général")); - } - #[test] fn test_content_safe() { use model::{ |