diff --git a/ruma-appservice-api/src/lib.rs b/ruma-appservice-api/src/lib.rs index f7211f0f..475b088d 100644 --- a/ruma-appservice-api/src/lib.rs +++ b/ruma-appservice-api/src/lib.rs @@ -2,7 +2,7 @@ //! endpoint in the [Matrix](https://matrix.org/) application service API specification. These //! types can be shared by application service and server code. -#![warn(missing_copy_implementations, missing_debug_implementations, missing_docs)] +#![warn(missing_debug_implementations, missing_docs)] pub mod event; pub mod query; diff --git a/ruma-client-api/src/lib.rs b/ruma-client-api/src/lib.rs index 304146f6..a1327351 100644 --- a/ruma-client-api/src/lib.rs +++ b/ruma-client-api/src/lib.rs @@ -2,7 +2,7 @@ //! endpoint in the [Matrix](https://matrix.org/) client API specification. These types can be //! shared by client and server code. -#![warn(missing_copy_implementations, missing_debug_implementations, missing_docs)] +#![warn(missing_debug_implementations, missing_docs)] pub mod error; pub mod r0; diff --git a/ruma-client-api/src/r0/account/register.rs b/ruma-client-api/src/r0/account/register.rs index 8a0b7eaf..78f628c6 100644 --- a/ruma-client-api/src/r0/account/register.rs +++ b/ruma-client-api/src/r0/account/register.rs @@ -100,7 +100,7 @@ impl Response { } /// The kind of account being registered. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[serde(rename_all = "snake_case")] pub enum RegistrationKind { /// A guest account diff --git a/ruma-client-api/src/r0/capabilities/get_capabilities.rs b/ruma-client-api/src/r0/capabilities/get_capabilities.rs index b55aad6e..0b04d48d 100644 --- a/ruma-client-api/src/r0/capabilities/get_capabilities.rs +++ b/ruma-client-api/src/r0/capabilities/get_capabilities.rs @@ -83,10 +83,10 @@ impl Capabilities { } /// Information about the m.change_password capability -#[derive(Clone, Copy, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct ChangePasswordCapability { - /// True if the user can change their password, false otherwise. + /// `true` if the user can change their password, `false` otherwise. pub enabled: bool, } diff --git a/ruma-client-api/src/r0/filter.rs b/ruma-client-api/src/r0/filter.rs index ea372dba..ca23d741 100644 --- a/ruma-client-api/src/r0/filter.rs +++ b/ruma-client-api/src/r0/filter.rs @@ -35,7 +35,7 @@ impl Default for EventFormat { } /// Filters to be applied to room events. -#[derive(Clone, Copy, Debug, Default, Outgoing, Serialize)] +#[derive(Clone, Debug, Default, Outgoing, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] #[incoming_derive(Clone, Default, Serialize)] pub struct RoomEventFilter<'a> { @@ -142,7 +142,7 @@ impl IncomingRoomEventFilter { } /// Filters to be applied to room data. -#[derive(Clone, Copy, Debug, Default, Outgoing, Serialize)] +#[derive(Clone, Debug, Default, Outgoing, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] #[incoming_derive(Clone, Default, Serialize)] pub struct RoomFilter<'a> { @@ -224,7 +224,7 @@ impl IncomingRoomFilter { } /// Filter for non-room data. -#[derive(Clone, Copy, Debug, Default, Outgoing, Serialize)] +#[derive(Clone, Debug, Default, Outgoing, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] #[incoming_derive(Clone, Default, Serialize)] pub struct Filter<'a> { diff --git a/ruma-client-api/src/r0/keys.rs b/ruma-client-api/src/r0/keys.rs index e5136c2b..a0e85825 100644 --- a/ruma-client-api/src/r0/keys.rs +++ b/ruma-client-api/src/r0/keys.rs @@ -54,7 +54,7 @@ pub struct CrossSigningKey { } /// The usage of a cross signing key. -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "snake_case")] pub enum KeyUsage { /// Master key. diff --git a/ruma-client-api/src/r0/message/get_message_events.rs b/ruma-client-api/src/r0/message/get_message_events.rs index c2824f8c..884f974d 100644 --- a/ruma-client-api/src/r0/message/get_message_events.rs +++ b/ruma-client-api/src/r0/message/get_message_events.rs @@ -120,7 +120,7 @@ fn is_default_limit(val: &UInt) -> bool { } /// The direction to return events from. -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub enum Direction { /// Return events backwards in time from the requested `from` token. #[serde(rename = "b")] diff --git a/ruma-client-api/src/r0/search/search_events.rs b/ruma-client-api/src/r0/search/search_events.rs index 7cee0927..593dbb7b 100644 --- a/ruma-client-api/src/r0/search/search_events.rs +++ b/ruma-client-api/src/r0/search/search_events.rs @@ -118,7 +118,7 @@ impl<'a> Criteria<'a> { } /// Configures whether any context for the events returned are included in the response. -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct EventContext { /// How many events before the result are returned. @@ -250,7 +250,7 @@ pub enum GroupingKey { } /// Requests that the server partitions the result set based on the provided list of keys. -#[derive(Clone, Copy, Default, Debug, Outgoing, Serialize)] +#[derive(Clone, Default, Debug, Outgoing, Serialize)] #[incoming_derive(Default)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct Groupings<'a> { diff --git a/ruma-client-api/src/r0/session/get_login_types.rs b/ruma-client-api/src/r0/session/get_login_types.rs index b17b99c3..c2050663 100644 --- a/ruma-client-api/src/r0/session/get_login_types.rs +++ b/ruma-client-api/src/r0/session/get_login_types.rs @@ -39,7 +39,7 @@ impl Response { } /// An authentication mechanism. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[serde(tag = "type")] pub enum LoginType { /// A password is supplied to authenticate. diff --git a/ruma-client-api/src/r0/session/login.rs b/ruma-client-api/src/r0/session/login.rs index 71cefab5..2337d6b1 100644 --- a/ruma-client-api/src/r0/session/login.rs +++ b/ruma-client-api/src/r0/session/login.rs @@ -107,7 +107,7 @@ pub enum UserInfo<'a> { } /// The authentication mechanism. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Outgoing, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Outgoing, Serialize)] #[serde(tag = "type")] pub enum LoginInfo<'a> { /// A password is supplied to authenticate. diff --git a/ruma-client-api/src/r0/sync/sync_events.rs b/ruma-client-api/src/r0/sync/sync_events.rs index a8935172..46084624 100644 --- a/ruma-client-api/src/r0/sync/sync_events.rs +++ b/ruma-client-api/src/r0/sync/sync_events.rs @@ -264,7 +264,7 @@ impl JoinedRoom { } /// unread notifications count -#[derive(Clone, Copy, Default, Debug, Deserialize, Serialize)] +#[derive(Clone, Default, Debug, Deserialize, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct UnreadNotificationsCount { /// The number of unread notifications for this room with the highlight flag set. diff --git a/ruma-client/src/lib.rs b/ruma-client/src/lib.rs index f2f5f2eb..6bc450c1 100644 --- a/ruma-client/src/lib.rs +++ b/ruma-client/src/lib.rs @@ -98,7 +98,7 @@ //! ``` #![warn(rust_2018_idioms)] -#![deny(missing_copy_implementations, missing_debug_implementations, missing_docs)] +#![deny(missing_debug_implementations, missing_docs)] use std::{ convert::TryFrom, diff --git a/ruma-events/src/error.rs b/ruma-events/src/error.rs index 5aba15c6..f446db05 100644 --- a/ruma-events/src/error.rs +++ b/ruma-events/src/error.rs @@ -19,7 +19,7 @@ impl Display for InvalidInput { impl Error for InvalidInput {} /// An error when attempting to create a value from a string via the `FromStr` trait. -#[derive(Clone, Copy, Eq, Debug, Hash, PartialEq)] +#[derive(Clone, Eq, Debug, Hash, PartialEq)] pub struct FromStrError; impl Display for FromStrError { diff --git a/ruma-events/src/room/member.rs b/ruma-events/src/room/member.rs index cdc126fd..b5d038cc 100644 --- a/ruma-events/src/room/member.rs +++ b/ruma-events/src/room/member.rs @@ -116,7 +116,7 @@ pub struct SignedContent { } /// Translation of the membership change in `m.room.member` event. -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub enum MembershipChange { /// No change. diff --git a/ruma-events/src/room/power_levels.rs b/ruma-events/src/room/power_levels.rs index d0d60123..3fe22c93 100644 --- a/ruma-events/src/room/power_levels.rs +++ b/ruma-events/src/room/power_levels.rs @@ -127,7 +127,7 @@ impl Default for PowerLevelsEventContent { } /// The power level requirements for specific notification types. -#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] pub struct NotificationPowerLevels { /// The level required to trigger an `@room` notification. #[cfg_attr( diff --git a/ruma-identifiers/src/lib.rs b/ruma-identifiers/src/lib.rs index d2825383..7a2eb1c6 100644 --- a/ruma-identifiers/src/lib.rs +++ b/ruma-identifiers/src/lib.rs @@ -1,12 +1,7 @@ //! Crate **ruma_identifiers** contains types for [Matrix](https://matrix.org/) identifiers //! for events, rooms, room aliases, room versions, and users. -#![warn( - rust_2018_idioms, - missing_copy_implementations, - missing_debug_implementations, - missing_docs -)] +#![warn(rust_2018_idioms, missing_debug_implementations, missing_docs)] #![cfg_attr(docsrs, feature(doc_cfg))] // Renamed in `Cargo.toml` so we can have a serde feature. diff --git a/ruma-push-gateway-api/src/send_event_notification/v1.rs b/ruma-push-gateway-api/src/send_event_notification/v1.rs index f47dc3e5..aff29348 100644 --- a/ruma-push-gateway-api/src/send_event_notification/v1.rs +++ b/ruma-push-gateway-api/src/send_event_notification/v1.rs @@ -154,7 +154,7 @@ impl Default for NotificationPriority { } /// Type for passing information about notification counts. -#[derive(Clone, Copy, Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct NotificationCounts { /// The number of unread messages a user has across all of the rooms they diff --git a/ruma-signatures/src/lib.rs b/ruma-signatures/src/lib.rs index 7675175d..c3a3ad51 100644 --- a/ruma-signatures/src/lib.rs +++ b/ruma-signatures/src/lib.rs @@ -42,7 +42,7 @@ //! these respective functions for more details and full examples of use. #![warn(rust_2018_idioms)] -#![deny(missing_copy_implementations, missing_debug_implementations, missing_docs)] +#![deny(missing_debug_implementations, missing_docs)] use std::{ error::Error as StdError, @@ -117,7 +117,7 @@ impl From for Error { } /// The algorithm used for signing data. -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, AsRefStr, DisplayAsRefStr)] +#[derive(Clone, Debug, Eq, Hash, PartialEq, AsRefStr, DisplayAsRefStr)] #[ruma_enum(rename_all = "snake_case")] pub enum Algorithm { /// The Ed25519 digital signature algorithm. diff --git a/ruma-signatures/src/signatures.rs b/ruma-signatures/src/signatures.rs index ad8112a4..a599915a 100644 --- a/ruma-signatures/src/signatures.rs +++ b/ruma-signatures/src/signatures.rs @@ -62,8 +62,8 @@ impl Signature { } /// The algorithm used to generate the signature. - pub fn algorithm(&self) -> Algorithm { - self.algorithm + pub fn algorithm(&self) -> &Algorithm { + &self.algorithm } /// The raw bytes of the signature. diff --git a/ruma-signatures/src/verification.rs b/ruma-signatures/src/verification.rs index 5709b108..106a9c42 100644 --- a/ruma-signatures/src/verification.rs +++ b/ruma-signatures/src/verification.rs @@ -23,7 +23,7 @@ pub trait Verifier { } /// A verifier for Ed25519 digital signatures. -#[derive(Clone, Copy, Debug, Default, PartialEq)] +#[derive(Debug, Default, PartialEq)] pub struct Ed25519Verifier; impl Verifier for Ed25519Verifier { @@ -46,7 +46,7 @@ impl Verifier for Ed25519Verifier { /// calculated during verification. This is not necessarily an error condition, as it may indicate /// that the event has been redacted. In this case, receiving homeservers should store a redacted /// version of the event. -#[derive(Debug, Clone, Copy, Hash, PartialEq)] +#[derive(Clone, Debug, Hash, PartialEq)] pub enum Verified { /// All signatures are valid and the content hashes match. All,