mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-29 03:28:34 +00:00
Remove clone
This commit is contained in:
@@ -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.
|
||||
///
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user