Remove clone

This commit is contained in:
Erik Johnston
2026-06-29 10:00:08 +01:00
parent 0efa5d5b4f
commit 417e38b679
2 changed files with 5 additions and 9 deletions
+5 -8
View File
@@ -95,13 +95,10 @@ pub use vmsc4242::EventFormatVMSC4242;
/// pyclass.
///
/// The `signatures` and `unsigned` fields are kept separate from the other
/// fields as they are mutable. Note the derived [`Clone`] is *shallow*: it
/// shares the mutable `signatures`/`unsigned`/internal state behind their
/// `Arc`s (cheap, and fine for read-only uses such as bundled aggregations).
/// Use [`FormattedEvent::deep_copy`] when an independently-mutable copy is
/// required. `common_fields` and `specific_fields` are both
/// `#[serde(flatten)]`ed so that the serialised JSON is a single flat object
/// matching the Matrix spec.
/// fields as they are mutable. Use [`FormattedEvent::deep_copy`] when an
/// independently-mutable copy is required. `common_fields` and
/// `specific_fields` are both `#[serde(flatten)]`ed so that the serialised JSON
/// is a single flat object matching the Matrix spec.
///
/// Note, deserialization of this struct must not be done from
/// [`serde_json::Value`] nor [`pythonize::depythonize`], due to a bug with
@@ -109,7 +106,7 @@ pub use vmsc4242::EventFormatVMSC4242;
/// Instead, deserialize directly from a JSON string with
/// `serde_json::from_str`. See https://github.com/serde-rs/serde/issues/2230
/// for details.
#[derive(Clone, Serialize, Deserialize)]
#[derive(Serialize, Deserialize)]
pub struct FormattedEvent<E = Arc<EventFormatEnum>> {
/// The event's signatures.
///
-1
View File
@@ -141,7 +141,6 @@ pub fn register_module(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()>
/// `Clone` is shallow (see [`FormattedEvent`]) and lets an `Event` be held by
/// value, e.g. inside [`BundledAggregations`](crate::events::relations::BundledAggregations).
#[pyclass(frozen, weakref, skip_from_py_object)]
#[derive(Clone)]
pub struct Event {
/// The parsed event JSON.
parsed_event: FormattedEvent,