clippy: add must_use attribute
This commit is contained in:
@@ -62,14 +62,17 @@ impl crate::Service for Service {
|
|||||||
|
|
||||||
#[implement(Service)]
|
#[implement(Service)]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub fn keypair(&self) -> &Ed25519KeyPair { &self.keypair }
|
pub fn keypair(&self) -> &Ed25519KeyPair { &self.keypair }
|
||||||
|
|
||||||
#[implement(Service)]
|
#[implement(Service)]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub fn active_key_id(&self) -> &ServerSigningKeyId { self.active_verify_key().0 }
|
pub fn active_key_id(&self) -> &ServerSigningKeyId { self.active_verify_key().0 }
|
||||||
|
|
||||||
#[implement(Service)]
|
#[implement(Service)]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub fn active_verify_key(&self) -> (&ServerSigningKeyId, &VerifyKey) {
|
pub fn active_verify_key(&self) -> (&ServerSigningKeyId, &VerifyKey) {
|
||||||
debug_assert!(self.verify_keys.len() <= 1, "more than one active verify_key");
|
debug_assert!(self.verify_keys.len() <= 1, "more than one active verify_key");
|
||||||
self.verify_keys
|
self.verify_keys
|
||||||
|
|||||||
@@ -313,6 +313,7 @@ impl Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new sync filter. Returns the filter id.
|
/// Creates a new sync filter. Returns the filter id.
|
||||||
|
#[must_use]
|
||||||
pub fn create_filter(&self, user_id: &UserId, filter: &FilterDefinition) -> String {
|
pub fn create_filter(&self, user_id: &UserId, filter: &FilterDefinition) -> String {
|
||||||
let filter_id = utils::random_string(4);
|
let filter_id = utils::random_string(4);
|
||||||
|
|
||||||
@@ -388,6 +389,7 @@ impl Service {
|
|||||||
|
|
||||||
/// Creates a short-lived login token, which can be used to log in using the
|
/// Creates a short-lived login token, which can be used to log in using the
|
||||||
/// `m.login.token` mechanism.
|
/// `m.login.token` mechanism.
|
||||||
|
#[must_use]
|
||||||
pub fn create_login_token(&self, user_id: &UserId, token: &str) -> u64 {
|
pub fn create_login_token(&self, user_id: &UserId, token: &str) -> u64 {
|
||||||
use std::num::Saturating as Sat;
|
use std::num::Saturating as Sat;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user