(v: &CachedGuild)
| 53 | |
| 54 | impl From<&CachedGuild> for Guild { |
| 55 | fn from(v: &CachedGuild) -> Self { |
| 56 | Self { |
| 57 | afk_channel_id: v.afk_channel_id().as_ref().map(ToString::to_string), |
| 58 | afk_timeout: NotBigU64(v.afk_timeout().get() as u64), |
| 59 | application_id: v.application_id().as_ref().map(ToString::to_string), |
| 60 | banner: v.banner().map(ToString::to_string), |
| 61 | default_message_notifications: v.default_message_notifications().into(), |
| 62 | description: v.description().map(ToString::to_string), |
| 63 | discovery_splash: v.discovery_splash().map(ToString::to_string), |
| 64 | explicit_content_filter: v.explicit_content_filter().into(), |
| 65 | features: v |
| 66 | .features() |
| 67 | .map(|v| Cow::<str>::from(v.clone()).to_string()) |
| 68 | .collect(), |
| 69 | icon: v.icon().map(ToString::to_string), |
| 70 | id: v.id().to_string(), |
| 71 | joined_at: v |
| 72 | .joined_at() |
| 73 | .map(|ts| NotBigU64(ts.as_micros() as u64 / 1000)) |
| 74 | .unwrap_or_default(), |
| 75 | max_members: v.max_members().map(NotBigU64), |
| 76 | max_presences: v.max_presences().map(NotBigU64), |
| 77 | member_count: v.member_count().map(NotBigU64).unwrap_or_default(), |
| 78 | mfa_level: v.mfa_level().into(), |
| 79 | name: v.name().to_string(), |
| 80 | nsfw_level: v.nsfw_level().into(), |
| 81 | owner_id: v.owner_id().to_string(), |
| 82 | preferred_locale: v.preferred_locale().to_string(), |
| 83 | premium_subscription_count: v |
| 84 | .premium_subscription_count() |
| 85 | .map(NotBigU64) |
| 86 | .unwrap_or_default(), |
| 87 | premium_tier: v.premium_tier().into(), |
| 88 | rules_channel_id: v.rules_channel_id().as_ref().map(ToString::to_string), |
| 89 | splash: v.splash().map(ToString::to_string), |
| 90 | system_channel_id: v.system_channel_id().as_ref().map(ToString::to_string), |
| 91 | vanity_url_code: v.vanity_url_code().map(ToString::to_string), |
| 92 | verification_level: v.verification_level().into(), |
| 93 | widget_channel_id: v.widget_channel_id().as_ref().map(ToString::to_string), |
| 94 | widget_enabled: v.widget_enabled(), |
| 95 | system_channel_flags: v.system_channel_flags().into(), |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | impl From<BrokerGuild> for Guild { |
nothing calls this directly
no test coverage detected