chore(base): Move the Room::MAX_ENCRYPTED_EVENTS constant in latest_event.

This patch moves the declaration of the `Room::MAX_ENCRYPTED_TESTS`
constants in the `latest_event` module.
This commit is contained in:
Ivan Enderlin
2025-05-21 11:07:57 +02:00
parent 2433e91a6c
commit a71e7923e0
2 changed files with 5 additions and 5 deletions

View File

@@ -13,7 +13,7 @@
// limitations under the License.
#[cfg(feature = "e2e-encryption")]
use std::collections::BTreeMap;
use std::{collections::BTreeMap, num::NonZeroUsize};
use super::Room;
#[cfg(feature = "e2e-encryption")]
@@ -24,6 +24,10 @@ use crate::latest_event::LatestEvent;
use ruma::{events::AnySyncTimelineEvent, serde::Raw, OwnedRoomId};
impl Room {
/// The size of the latest_encrypted_events RingBuffer
#[cfg(feature = "e2e-encryption")]
pub(super) const MAX_ENCRYPTED_EVENTS: NonZeroUsize = NonZeroUsize::new(10).unwrap();
/// Return the last event in this room, if one has been cached during
/// sliding sync.
pub fn latest_event(&self) -> Option<LatestEvent> {

View File

@@ -115,10 +115,6 @@ pub struct Room {
}
impl Room {
/// The size of the latest_encrypted_events RingBuffer
#[cfg(feature = "e2e-encryption")]
const MAX_ENCRYPTED_EVENTS: std::num::NonZeroUsize = std::num::NonZeroUsize::new(10).unwrap();
pub(crate) fn new(
own_user_id: &UserId,
store: Arc<DynStateStore>,