events: Remove recently-introduced builder-style methods

It's unclear whether they are that important, and whether their argument
types make sense as-is.
This commit is contained in:
Jonas Platte 2024-03-05 08:52:14 +01:00
parent 0d72acd5e9
commit a80caa4c21
4 changed files with 0 additions and 72 deletions

View File

@ -80,24 +80,6 @@ impl AudioMessageEventContent {
Self::new(body, MediaSource::Encrypted(Box::new(file)))
}
/// Creates a new `AudioMessageEventContent` from `self` with the `filename` field set to the
/// given value.
///
/// Since the field is public, you can also assign to it directly. This method merely acts
/// as a shorthand for that, because it is very common to set this field.
pub fn filename(self, filename: impl Into<Option<String>>) -> Self {
Self { filename: filename.into(), ..self }
}
/// Creates a new `AudioMessageEventContent` from `self` with the `formatted` field set to the
/// given value.
///
/// Since the field is public, you can also assign to it directly. This method merely acts
/// as a shorthand for that, because it is very common to set this field.
pub fn formatted(self, formatted: impl Into<Option<FormattedBody>>) -> Self {
Self { formatted: formatted.into(), ..self }
}
/// Creates a new `AudioMessageEventContent` from `self` with the `info` field set to the given
/// value.
///

View File

@ -52,24 +52,6 @@ impl FileMessageEventContent {
Self::new(body, MediaSource::Encrypted(Box::new(file)))
}
/// Creates a new `FileMessageEventContent` from `self` with the `filename` field set to the
/// given value.
///
/// Since the field is public, you can also assign to it directly. This method merely acts
/// as a shorthand for that, because it is very common to set this field.
pub fn filename(self, filename: impl Into<Option<String>>) -> Self {
Self { filename: filename.into(), ..self }
}
/// Creates a new `FileMessageEventContent` from `self` with the `formatted` field set to the
/// given value.
///
/// Since the field is public, you can also assign to it directly. This method merely acts
/// as a shorthand for that, because it is very common to set this field.
pub fn formatted(self, formatted: impl Into<Option<FormattedBody>>) -> Self {
Self { formatted: formatted.into(), ..self }
}
/// Creates a new `FileMessageEventContent` from `self` with the `info` field set to the given
/// value.
///

View File

@ -51,24 +51,6 @@ impl ImageMessageEventContent {
Self::new(body, MediaSource::Encrypted(Box::new(file)))
}
/// Creates a new `ImageMessageEventContent` from `self` with the `filename` field set to the
/// given value.
///
/// Since the field is public, you can also assign to it directly. This method merely acts
/// as a shorthand for that, because it is very common to set this field.
pub fn filename(self, filename: impl Into<Option<String>>) -> Self {
Self { filename: filename.into(), ..self }
}
/// Creates a new `ImageMessageEventContent` from `self` with the `formatted` field set to the
/// given value.
///
/// Since the field is public, you can also assign to it directly. This method merely acts
/// as a shorthand for that, because it is very common to set this field.
pub fn formatted(self, formatted: impl Into<Option<FormattedBody>>) -> Self {
Self { formatted: formatted.into(), ..self }
}
/// Creates a new `ImageMessageEventContent` from `self` with the `info` field set to the given
/// value.
///

View File

@ -54,24 +54,6 @@ impl VideoMessageEventContent {
Self::new(body, MediaSource::Encrypted(Box::new(file)))
}
/// Creates a new `VideoMessageEventContent` from `self` with the `filename` field set to the
/// given value.
///
/// Since the field is public, you can also assign to it directly. This method merely acts
/// as a shorthand for that, because it is very common to set this field.
pub fn filename(self, filename: impl Into<Option<String>>) -> Self {
Self { filename: filename.into(), ..self }
}
/// Creates a new `VideoMessageEventContent` from `self` with the `formatted` field set to the
/// given value.
///
/// Since the field is public, you can also assign to it directly. This method merely acts
/// as a shorthand for that, because it is very common to set this field.
pub fn formatted(self, formatted: impl Into<Option<FormattedBody>>) -> Self {
Self { formatted: formatted.into(), ..self }
}
/// Creates a new `VideoMessageEventContent` from `self` with the `info` field set to the given
/// value.
///