From a05ab96037cee372b31e5c4f217b42e6d83428e5 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:33:40 +0000 Subject: [PATCH] generated protobuf --- livekit-protocol/src/livekit.serde.rs | 2367 ++++++++++++------------- 1 file changed, 1174 insertions(+), 1193 deletions(-) diff --git a/livekit-protocol/src/livekit.serde.rs b/livekit-protocol/src/livekit.serde.rs index 1e098430..1b82f33f 100644 --- a/livekit-protocol/src/livekit.serde.rs +++ b/livekit-protocol/src/livekit.serde.rs @@ -68,21 +68,21 @@ impl<'de> serde::Deserialize<'de> for ActiveSpeakerUpdate { formatter.write_str("struct livekit.ActiveSpeakerUpdate") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut speakers__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Speakers => { if speakers__.is_some() { return Err(serde::de::Error::duplicate_field("speakers")); } - speakers__ = Some(map.next_value()?); + speakers__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -155,8 +155,8 @@ impl serde::Serialize for AddTrackRequest { struct_ser.serialize_field("name", &self.name)?; } if self.r#type != 0 { - let v = TrackType::from_i32(self.r#type) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; + let v = TrackType::try_from(self.r#type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; struct_ser.serialize_field("type", &v)?; } if self.width != 0 { @@ -172,8 +172,8 @@ impl serde::Serialize for AddTrackRequest { struct_ser.serialize_field("disableDtx", &self.disable_dtx)?; } if self.source != 0 { - let v = TrackSource::from_i32(self.source) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; + let v = TrackSource::try_from(self.source) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; struct_ser.serialize_field("source", &v)?; } if !self.layers.is_empty() { @@ -192,8 +192,8 @@ impl serde::Serialize for AddTrackRequest { struct_ser.serialize_field("disableRed", &self.disable_red)?; } if self.encryption != 0 { - let v = encryption::Type::from_i32(self.encryption) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.encryption)))?; + let v = encryption::Type::try_from(self.encryption) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.encryption)))?; struct_ser.serialize_field("encryption", &v)?; } if !self.stream.is_empty() { @@ -298,7 +298,7 @@ impl<'de> serde::Deserialize<'de> for AddTrackRequest { formatter.write_str("struct livekit.AddTrackRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -317,32 +317,32 @@ impl<'de> serde::Deserialize<'de> for AddTrackRequest { let mut disable_red__ = None; let mut encryption__ = None; let mut stream__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Cid => { if cid__.is_some() { return Err(serde::de::Error::duplicate_field("cid")); } - cid__ = Some(map.next_value()?); + cid__ = Some(map_.next_value()?); } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::Type => { if r#type__.is_some() { return Err(serde::de::Error::duplicate_field("type")); } - r#type__ = Some(map.next_value::()? as i32); + r#type__ = Some(map_.next_value::()? as i32); } GeneratedField::Width => { if width__.is_some() { return Err(serde::de::Error::duplicate_field("width")); } width__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Height => { @@ -350,71 +350,71 @@ impl<'de> serde::Deserialize<'de> for AddTrackRequest { return Err(serde::de::Error::duplicate_field("height")); } height__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Muted => { if muted__.is_some() { return Err(serde::de::Error::duplicate_field("muted")); } - muted__ = Some(map.next_value()?); + muted__ = Some(map_.next_value()?); } GeneratedField::DisableDtx => { if disable_dtx__.is_some() { return Err(serde::de::Error::duplicate_field("disableDtx")); } - disable_dtx__ = Some(map.next_value()?); + disable_dtx__ = Some(map_.next_value()?); } GeneratedField::Source => { if source__.is_some() { return Err(serde::de::Error::duplicate_field("source")); } - source__ = Some(map.next_value::()? as i32); + source__ = Some(map_.next_value::()? as i32); } GeneratedField::Layers => { if layers__.is_some() { return Err(serde::de::Error::duplicate_field("layers")); } - layers__ = Some(map.next_value()?); + layers__ = Some(map_.next_value()?); } GeneratedField::SimulcastCodecs => { if simulcast_codecs__.is_some() { return Err(serde::de::Error::duplicate_field("simulcastCodecs")); } - simulcast_codecs__ = Some(map.next_value()?); + simulcast_codecs__ = Some(map_.next_value()?); } GeneratedField::Sid => { if sid__.is_some() { return Err(serde::de::Error::duplicate_field("sid")); } - sid__ = Some(map.next_value()?); + sid__ = Some(map_.next_value()?); } GeneratedField::Stereo => { if stereo__.is_some() { return Err(serde::de::Error::duplicate_field("stereo")); } - stereo__ = Some(map.next_value()?); + stereo__ = Some(map_.next_value()?); } GeneratedField::DisableRed => { if disable_red__.is_some() { return Err(serde::de::Error::duplicate_field("disableRed")); } - disable_red__ = Some(map.next_value()?); + disable_red__ = Some(map_.next_value()?); } GeneratedField::Encryption => { if encryption__.is_some() { return Err(serde::de::Error::duplicate_field("encryption")); } - encryption__ = Some(map.next_value::()? as i32); + encryption__ = Some(map_.next_value::()? as i32); } GeneratedField::Stream => { if stream__.is_some() { return Err(serde::de::Error::duplicate_field("stream")); } - stream__ = Some(map.next_value()?); + stream__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -546,7 +546,7 @@ impl<'de> serde::Deserialize<'de> for AliOssUpload { formatter.write_str("struct livekit.AliOSSUpload") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -555,40 +555,40 @@ impl<'de> serde::Deserialize<'de> for AliOssUpload { let mut region__ = None; let mut endpoint__ = None; let mut bucket__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::AccessKey => { if access_key__.is_some() { return Err(serde::de::Error::duplicate_field("accessKey")); } - access_key__ = Some(map.next_value()?); + access_key__ = Some(map_.next_value()?); } GeneratedField::Secret => { if secret__.is_some() { return Err(serde::de::Error::duplicate_field("secret")); } - secret__ = Some(map.next_value()?); + secret__ = Some(map_.next_value()?); } GeneratedField::Region => { if region__.is_some() { return Err(serde::de::Error::duplicate_field("region")); } - region__ = Some(map.next_value()?); + region__ = Some(map_.next_value()?); } GeneratedField::Endpoint => { if endpoint__.is_some() { return Err(serde::de::Error::duplicate_field("endpoint")); } - endpoint__ = Some(map.next_value()?); + endpoint__ = Some(map_.next_value()?); } GeneratedField::Bucket => { if bucket__.is_some() { return Err(serde::de::Error::duplicate_field("bucket")); } - bucket__ = Some(map.next_value()?); + bucket__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -643,10 +643,9 @@ impl<'de> serde::Deserialize<'de> for AudioCodec { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(AudioCodec::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -656,10 +655,9 @@ impl<'de> serde::Deserialize<'de> for AudioCodec { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(AudioCodec::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -707,8 +705,8 @@ impl serde::Serialize for AutoParticipantEgress { if let Some(v) = self.options.as_ref() { match v { auto_participant_egress::Options::Preset(v) => { - let v = EncodingOptionsPreset::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + let v = EncodingOptionsPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("preset", &v)?; } auto_participant_egress::Options::Advanced(v) => { @@ -781,42 +779,42 @@ impl<'de> serde::Deserialize<'de> for AutoParticipantEgress { formatter.write_str("struct livekit.AutoParticipantEgress") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut file_outputs__ = None; let mut segment_outputs__ = None; let mut options__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::FileOutputs => { if file_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("fileOutputs")); } - file_outputs__ = Some(map.next_value()?); + file_outputs__ = Some(map_.next_value()?); } GeneratedField::SegmentOutputs => { if segment_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("segmentOutputs")); } - segment_outputs__ = Some(map.next_value()?); + segment_outputs__ = Some(map_.next_value()?); } GeneratedField::Preset => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("preset")); } - options__ = map.next_value::<::std::option::Option>()?.map(|x| auto_participant_egress::Options::Preset(x as i32)); + options__ = map_.next_value::<::std::option::Option>()?.map(|x| auto_participant_egress::Options::Preset(x as i32)); } GeneratedField::Advanced => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("advanced")); } - options__ = map.next_value::<::std::option::Option<_>>()?.map(auto_participant_egress::Options::Advanced) + options__ = map_.next_value::<::std::option::Option<_>>()?.map(auto_participant_egress::Options::Advanced) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -934,50 +932,50 @@ impl<'de> serde::Deserialize<'de> for AutoTrackEgress { formatter.write_str("struct livekit.AutoTrackEgress") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut filepath__ = None; let mut disable_manifest__ = None; let mut output__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Filepath => { if filepath__.is_some() { return Err(serde::de::Error::duplicate_field("filepath")); } - filepath__ = Some(map.next_value()?); + filepath__ = Some(map_.next_value()?); } GeneratedField::DisableManifest => { if disable_manifest__.is_some() { return Err(serde::de::Error::duplicate_field("disableManifest")); } - disable_manifest__ = Some(map.next_value()?); + disable_manifest__ = Some(map_.next_value()?); } GeneratedField::S3 => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("s3")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(auto_track_egress::Output::S3) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(auto_track_egress::Output::S3) ; } GeneratedField::Gcp => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("gcp")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(auto_track_egress::Output::Gcp) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(auto_track_egress::Output::Gcp) ; } GeneratedField::Azure => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("azure")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(auto_track_egress::Output::Azure) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(auto_track_egress::Output::Azure) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -1081,35 +1079,35 @@ impl<'de> serde::Deserialize<'de> for AzureBlobUpload { formatter.write_str("struct livekit.AzureBlobUpload") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut account_name__ = None; let mut account_key__ = None; let mut container_name__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::AccountName => { if account_name__.is_some() { return Err(serde::de::Error::duplicate_field("accountName")); } - account_name__ = Some(map.next_value()?); + account_name__ = Some(map_.next_value()?); } GeneratedField::AccountKey => { if account_key__.is_some() { return Err(serde::de::Error::duplicate_field("accountKey")); } - account_key__ = Some(map.next_value()?); + account_key__ = Some(map_.next_value()?); } GeneratedField::ContainerName => { if container_name__.is_some() { return Err(serde::de::Error::duplicate_field("containerName")); } - container_name__ = Some(map.next_value()?); + container_name__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -1162,10 +1160,9 @@ impl<'de> serde::Deserialize<'de> for CandidateProtocol { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(CandidateProtocol::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -1175,10 +1172,9 @@ impl<'de> serde::Deserialize<'de> for CandidateProtocol { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(CandidateProtocol::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -1238,10 +1234,9 @@ impl<'de> serde::Deserialize<'de> for ClientConfigSetting { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ClientConfigSetting::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -1251,10 +1246,9 @@ impl<'de> serde::Deserialize<'de> for ClientConfigSetting { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ClientConfigSetting::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -1306,16 +1300,16 @@ impl serde::Serialize for ClientConfiguration { struct_ser.serialize_field("screen", v)?; } if self.resume_connection != 0 { - let v = ClientConfigSetting::from_i32(self.resume_connection) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.resume_connection)))?; + let v = ClientConfigSetting::try_from(self.resume_connection) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.resume_connection)))?; struct_ser.serialize_field("resumeConnection", &v)?; } if let Some(v) = self.disabled_codecs.as_ref() { struct_ser.serialize_field("disabledCodecs", v)?; } if self.force_relay != 0 { - let v = ClientConfigSetting::from_i32(self.force_relay) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.force_relay)))?; + let v = ClientConfigSetting::try_from(self.force_relay) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.force_relay)))?; struct_ser.serialize_field("forceRelay", &v)?; } struct_ser.end() @@ -1387,7 +1381,7 @@ impl<'de> serde::Deserialize<'de> for ClientConfiguration { formatter.write_str("struct livekit.ClientConfiguration") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -1396,40 +1390,40 @@ impl<'de> serde::Deserialize<'de> for ClientConfiguration { let mut resume_connection__ = None; let mut disabled_codecs__ = None; let mut force_relay__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Video => { if video__.is_some() { return Err(serde::de::Error::duplicate_field("video")); } - video__ = map.next_value()?; + video__ = map_.next_value()?; } GeneratedField::Screen => { if screen__.is_some() { return Err(serde::de::Error::duplicate_field("screen")); } - screen__ = map.next_value()?; + screen__ = map_.next_value()?; } GeneratedField::ResumeConnection => { if resume_connection__.is_some() { return Err(serde::de::Error::duplicate_field("resumeConnection")); } - resume_connection__ = Some(map.next_value::()? as i32); + resume_connection__ = Some(map_.next_value::()? as i32); } GeneratedField::DisabledCodecs => { if disabled_codecs__.is_some() { return Err(serde::de::Error::duplicate_field("disabledCodecs")); } - disabled_codecs__ = map.next_value()?; + disabled_codecs__ = map_.next_value()?; } GeneratedField::ForceRelay => { if force_relay__.is_some() { return Err(serde::de::Error::duplicate_field("forceRelay")); } - force_relay__ = Some(map.next_value::()? as i32); + force_relay__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -1485,8 +1479,8 @@ impl serde::Serialize for ClientInfo { } let mut struct_ser = serializer.serialize_struct("livekit.ClientInfo", len)?; if self.sdk != 0 { - let v = client_info::Sdk::from_i32(self.sdk) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.sdk)))?; + let v = client_info::Sdk::try_from(self.sdk) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.sdk)))?; struct_ser.serialize_field("sdk", &v)?; } if !self.version.is_empty() { @@ -1600,7 +1594,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { formatter.write_str("struct livekit.ClientInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -1614,72 +1608,72 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { let mut browser_version__ = None; let mut address__ = None; let mut network__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Sdk => { if sdk__.is_some() { return Err(serde::de::Error::duplicate_field("sdk")); } - sdk__ = Some(map.next_value::()? as i32); + sdk__ = Some(map_.next_value::()? as i32); } GeneratedField::Version => { if version__.is_some() { return Err(serde::de::Error::duplicate_field("version")); } - version__ = Some(map.next_value()?); + version__ = Some(map_.next_value()?); } GeneratedField::Protocol => { if protocol__.is_some() { return Err(serde::de::Error::duplicate_field("protocol")); } protocol__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Os => { if os__.is_some() { return Err(serde::de::Error::duplicate_field("os")); } - os__ = Some(map.next_value()?); + os__ = Some(map_.next_value()?); } GeneratedField::OsVersion => { if os_version__.is_some() { return Err(serde::de::Error::duplicate_field("osVersion")); } - os_version__ = Some(map.next_value()?); + os_version__ = Some(map_.next_value()?); } GeneratedField::DeviceModel => { if device_model__.is_some() { return Err(serde::de::Error::duplicate_field("deviceModel")); } - device_model__ = Some(map.next_value()?); + device_model__ = Some(map_.next_value()?); } GeneratedField::Browser => { if browser__.is_some() { return Err(serde::de::Error::duplicate_field("browser")); } - browser__ = Some(map.next_value()?); + browser__ = Some(map_.next_value()?); } GeneratedField::BrowserVersion => { if browser_version__.is_some() { return Err(serde::de::Error::duplicate_field("browserVersion")); } - browser_version__ = Some(map.next_value()?); + browser_version__ = Some(map_.next_value()?); } GeneratedField::Address => { if address__.is_some() { return Err(serde::de::Error::duplicate_field("address")); } - address__ = Some(map.next_value()?); + address__ = Some(map_.next_value()?); } GeneratedField::Network => { if network__.is_some() { return Err(serde::de::Error::duplicate_field("network")); } - network__ = Some(map.next_value()?); + network__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -1755,10 +1749,9 @@ impl<'de> serde::Deserialize<'de> for client_info::Sdk { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(client_info::Sdk::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -1768,10 +1761,9 @@ impl<'de> serde::Deserialize<'de> for client_info::Sdk { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(client_info::Sdk::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -1879,28 +1871,28 @@ impl<'de> serde::Deserialize<'de> for Codec { formatter.write_str("struct livekit.Codec") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut mime__ = None; let mut fmtp_line__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Mime => { if mime__.is_some() { return Err(serde::de::Error::duplicate_field("mime")); } - mime__ = Some(map.next_value()?); + mime__ = Some(map_.next_value()?); } GeneratedField::FmtpLine => { if fmtp_line__.is_some() { return Err(serde::de::Error::duplicate_field("fmtpLine")); } - fmtp_line__ = Some(map.next_value()?); + fmtp_line__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -1954,10 +1946,9 @@ impl<'de> serde::Deserialize<'de> for ConnectionQuality { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ConnectionQuality::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -1967,10 +1958,9 @@ impl<'de> serde::Deserialize<'de> for ConnectionQuality { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ConnectionQuality::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -2014,8 +2004,8 @@ impl serde::Serialize for ConnectionQualityInfo { struct_ser.serialize_field("participantSid", &self.participant_sid)?; } if self.quality != 0 { - let v = ConnectionQuality::from_i32(self.quality) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; + let v = ConnectionQuality::try_from(self.quality) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; struct_ser.serialize_field("quality", &v)?; } if self.score != 0. { @@ -2082,37 +2072,37 @@ impl<'de> serde::Deserialize<'de> for ConnectionQualityInfo { formatter.write_str("struct livekit.ConnectionQualityInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut participant_sid__ = None; let mut quality__ = None; let mut score__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::ParticipantSid => { if participant_sid__.is_some() { return Err(serde::de::Error::duplicate_field("participantSid")); } - participant_sid__ = Some(map.next_value()?); + participant_sid__ = Some(map_.next_value()?); } GeneratedField::Quality => { if quality__.is_some() { return Err(serde::de::Error::duplicate_field("quality")); } - quality__ = Some(map.next_value::()? as i32); + quality__ = Some(map_.next_value::()? as i32); } GeneratedField::Score => { if score__.is_some() { return Err(serde::de::Error::duplicate_field("score")); } score__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -2195,21 +2185,21 @@ impl<'de> serde::Deserialize<'de> for ConnectionQualityUpdate { formatter.write_str("struct livekit.ConnectionQualityUpdate") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut updates__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Updates => { if updates__.is_some() { return Err(serde::de::Error::duplicate_field("updates")); } - updates__ = Some(map.next_value()?); + updates__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -2258,8 +2248,8 @@ impl serde::Serialize for CreateIngressRequest { } let mut struct_ser = serializer.serialize_struct("livekit.CreateIngressRequest", len)?; if self.input_type != 0 { - let v = IngressInput::from_i32(self.input_type) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.input_type)))?; + let v = IngressInput::try_from(self.input_type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.input_type)))?; struct_ser.serialize_field("inputType", &v)?; } if !self.url.is_empty() { @@ -2369,7 +2359,7 @@ impl<'de> serde::Deserialize<'de> for CreateIngressRequest { formatter.write_str("struct livekit.CreateIngressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -2382,64 +2372,64 @@ impl<'de> serde::Deserialize<'de> for CreateIngressRequest { let mut bypass_transcoding__ = None; let mut audio__ = None; let mut video__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::InputType => { if input_type__.is_some() { return Err(serde::de::Error::duplicate_field("inputType")); } - input_type__ = Some(map.next_value::()? as i32); + input_type__ = Some(map_.next_value::()? as i32); } GeneratedField::Url => { if url__.is_some() { return Err(serde::de::Error::duplicate_field("url")); } - url__ = Some(map.next_value()?); + url__ = Some(map_.next_value()?); } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::ParticipantIdentity => { if participant_identity__.is_some() { return Err(serde::de::Error::duplicate_field("participantIdentity")); } - participant_identity__ = Some(map.next_value()?); + participant_identity__ = Some(map_.next_value()?); } GeneratedField::ParticipantName => { if participant_name__.is_some() { return Err(serde::de::Error::duplicate_field("participantName")); } - participant_name__ = Some(map.next_value()?); + participant_name__ = Some(map_.next_value()?); } GeneratedField::BypassTranscoding => { if bypass_transcoding__.is_some() { return Err(serde::de::Error::duplicate_field("bypassTranscoding")); } - bypass_transcoding__ = Some(map.next_value()?); + bypass_transcoding__ = Some(map_.next_value()?); } GeneratedField::Audio => { if audio__.is_some() { return Err(serde::de::Error::duplicate_field("audio")); } - audio__ = map.next_value()?; + audio__ = map_.next_value()?; } GeneratedField::Video => { if video__.is_some() { return Err(serde::de::Error::duplicate_field("video")); } - video__ = map.next_value()?; + video__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -2606,7 +2596,7 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { formatter.write_str("struct livekit.CreateRoomRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -2619,20 +2609,20 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { let mut min_playout_delay__ = None; let mut max_playout_delay__ = None; let mut sync_streams__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::EmptyTimeout => { if empty_timeout__.is_some() { return Err(serde::de::Error::duplicate_field("emptyTimeout")); } empty_timeout__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::MaxParticipants => { @@ -2640,33 +2630,33 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { return Err(serde::de::Error::duplicate_field("maxParticipants")); } max_participants__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::NodeId => { if node_id__.is_some() { return Err(serde::de::Error::duplicate_field("nodeId")); } - node_id__ = Some(map.next_value()?); + node_id__ = Some(map_.next_value()?); } GeneratedField::Metadata => { if metadata__.is_some() { return Err(serde::de::Error::duplicate_field("metadata")); } - metadata__ = Some(map.next_value()?); + metadata__ = Some(map_.next_value()?); } GeneratedField::Egress => { if egress__.is_some() { return Err(serde::de::Error::duplicate_field("egress")); } - egress__ = map.next_value()?; + egress__ = map_.next_value()?; } GeneratedField::MinPlayoutDelay => { if min_playout_delay__.is_some() { return Err(serde::de::Error::duplicate_field("minPlayoutDelay")); } min_playout_delay__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::MaxPlayoutDelay => { @@ -2674,17 +2664,17 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { return Err(serde::de::Error::duplicate_field("maxPlayoutDelay")); } max_playout_delay__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::SyncStreams => { if sync_streams__.is_some() { return Err(serde::de::Error::duplicate_field("syncStreams")); } - sync_streams__ = Some(map.next_value()?); + sync_streams__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -2729,8 +2719,8 @@ impl serde::Serialize for DataChannelInfo { struct_ser.serialize_field("id", &self.id)?; } if self.target != 0 { - let v = SignalTarget::from_i32(self.target) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.target)))?; + let v = SignalTarget::try_from(self.target) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.target)))?; struct_ser.serialize_field("target", &v)?; } struct_ser.end() @@ -2793,37 +2783,37 @@ impl<'de> serde::Deserialize<'de> for DataChannelInfo { formatter.write_str("struct livekit.DataChannelInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut label__ = None; let mut id__ = None; let mut target__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Label => { if label__.is_some() { return Err(serde::de::Error::duplicate_field("label")); } - label__ = Some(map.next_value()?); + label__ = Some(map_.next_value()?); } GeneratedField::Id => { if id__.is_some() { return Err(serde::de::Error::duplicate_field("id")); } id__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Target => { if target__.is_some() { return Err(serde::de::Error::duplicate_field("target")); } - target__ = Some(map.next_value::()? as i32); + target__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -2853,8 +2843,8 @@ impl serde::Serialize for DataPacket { } let mut struct_ser = serializer.serialize_struct("livekit.DataPacket", len)?; if self.kind != 0 { - let v = data_packet::Kind::from_i32(self.kind) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; + let v = data_packet::Kind::try_from(self.kind) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; struct_ser.serialize_field("kind", &v)?; } if let Some(v) = self.value.as_ref() { @@ -2927,36 +2917,36 @@ impl<'de> serde::Deserialize<'de> for DataPacket { formatter.write_str("struct livekit.DataPacket") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut kind__ = None; let mut value__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Kind => { if kind__.is_some() { return Err(serde::de::Error::duplicate_field("kind")); } - kind__ = Some(map.next_value::()? as i32); + kind__ = Some(map_.next_value::()? as i32); } GeneratedField::User => { if value__.is_some() { return Err(serde::de::Error::duplicate_field("user")); } - value__ = map.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::User) + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::User) ; } GeneratedField::Speaker => { if value__.is_some() { return Err(serde::de::Error::duplicate_field("speaker")); } - value__ = map.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::Speaker) + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::Speaker) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -3006,10 +2996,9 @@ impl<'de> serde::Deserialize<'de> for data_packet::Kind { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(data_packet::Kind::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -3019,10 +3008,9 @@ impl<'de> serde::Deserialize<'de> for data_packet::Kind { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(data_packet::Kind::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -3112,21 +3100,21 @@ impl<'de> serde::Deserialize<'de> for DeleteIngressRequest { formatter.write_str("struct livekit.DeleteIngressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut ingress_id__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::IngressId => { if ingress_id__.is_some() { return Err(serde::de::Error::duplicate_field("ingressId")); } - ingress_id__ = Some(map.next_value()?); + ingress_id__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -3207,21 +3195,21 @@ impl<'de> serde::Deserialize<'de> for DeleteRoomRequest { formatter.write_str("struct livekit.DeleteRoomRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -3291,12 +3279,12 @@ impl<'de> serde::Deserialize<'de> for DeleteRoomResponse { formatter.write_str("struct livekit.DeleteRoomResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - while map.next_key::()?.is_some() { - let _ = map.next_value::()?; + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } Ok(DeleteRoomResponse { }) @@ -3415,57 +3403,57 @@ impl<'de> serde::Deserialize<'de> for DirectFileOutput { formatter.write_str("struct livekit.DirectFileOutput") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut filepath__ = None; let mut disable_manifest__ = None; let mut output__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Filepath => { if filepath__.is_some() { return Err(serde::de::Error::duplicate_field("filepath")); } - filepath__ = Some(map.next_value()?); + filepath__ = Some(map_.next_value()?); } GeneratedField::DisableManifest => { if disable_manifest__.is_some() { return Err(serde::de::Error::duplicate_field("disableManifest")); } - disable_manifest__ = Some(map.next_value()?); + disable_manifest__ = Some(map_.next_value()?); } GeneratedField::S3 => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("s3")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::S3) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::S3) ; } GeneratedField::Gcp => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("gcp")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::Gcp) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::Gcp) ; } GeneratedField::Azure => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("azure")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::Azure) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::Azure) ; } GeneratedField::AliOss => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("aliOSS")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::AliOss) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::AliOss) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -3557,28 +3545,28 @@ impl<'de> serde::Deserialize<'de> for DisabledCodecs { formatter.write_str("struct livekit.DisabledCodecs") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut codecs__ = None; let mut publish__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Codecs => { if codecs__.is_some() { return Err(serde::de::Error::duplicate_field("codecs")); } - codecs__ = Some(map.next_value()?); + codecs__ = Some(map_.next_value()?); } GeneratedField::Publish => { if publish__.is_some() { return Err(serde::de::Error::duplicate_field("publish")); } - publish__ = Some(map.next_value()?); + publish__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -3640,10 +3628,9 @@ impl<'de> serde::Deserialize<'de> for DisconnectReason { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(DisconnectReason::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -3653,10 +3640,9 @@ impl<'de> serde::Deserialize<'de> for DisconnectReason { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(DisconnectReason::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -3743,17 +3729,20 @@ impl serde::Serialize for EgressInfo { struct_ser.serialize_field("roomName", &self.room_name)?; } if self.status != 0 { - let v = EgressStatus::from_i32(self.status) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; + let v = EgressStatus::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; struct_ser.serialize_field("status", &v)?; } if self.started_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } if self.updated_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("updatedAt", ToString::to_string(&self.updated_at).as_str())?; } if !self.error.is_empty() { @@ -3926,7 +3915,7 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { formatter.write_str("struct livekit.EgressInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -3944,38 +3933,38 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { let mut image_results__ = None; let mut request__ = None; let mut result__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::EgressId => { if egress_id__.is_some() { return Err(serde::de::Error::duplicate_field("egressId")); } - egress_id__ = Some(map.next_value()?); + egress_id__ = Some(map_.next_value()?); } GeneratedField::RoomId => { if room_id__.is_some() { return Err(serde::de::Error::duplicate_field("roomId")); } - room_id__ = Some(map.next_value()?); + room_id__ = Some(map_.next_value()?); } GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::Status => { if status__.is_some() { return Err(serde::de::Error::duplicate_field("status")); } - status__ = Some(map.next_value::()? as i32); + status__ = Some(map_.next_value::()? as i32); } GeneratedField::StartedAt => { if started_at__.is_some() { return Err(serde::de::Error::duplicate_field("startedAt")); } started_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::EndedAt => { @@ -3983,7 +3972,7 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { return Err(serde::de::Error::duplicate_field("endedAt")); } ended_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::UpdatedAt => { @@ -3991,97 +3980,97 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { return Err(serde::de::Error::duplicate_field("updatedAt")); } updated_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Error => { if error__.is_some() { return Err(serde::de::Error::duplicate_field("error")); } - error__ = Some(map.next_value()?); + error__ = Some(map_.next_value()?); } GeneratedField::StreamResults => { if stream_results__.is_some() { return Err(serde::de::Error::duplicate_field("streamResults")); } - stream_results__ = Some(map.next_value()?); + stream_results__ = Some(map_.next_value()?); } GeneratedField::FileResults => { if file_results__.is_some() { return Err(serde::de::Error::duplicate_field("fileResults")); } - file_results__ = Some(map.next_value()?); + file_results__ = Some(map_.next_value()?); } GeneratedField::SegmentResults => { if segment_results__.is_some() { return Err(serde::de::Error::duplicate_field("segmentResults")); } - segment_results__ = Some(map.next_value()?); + segment_results__ = Some(map_.next_value()?); } GeneratedField::ImageResults => { if image_results__.is_some() { return Err(serde::de::Error::duplicate_field("imageResults")); } - image_results__ = Some(map.next_value()?); + image_results__ = Some(map_.next_value()?); } GeneratedField::RoomComposite => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("roomComposite")); } - request__ = map.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::RoomComposite) + request__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::RoomComposite) ; } GeneratedField::Web => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("web")); } - request__ = map.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::Web) + request__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::Web) ; } GeneratedField::Participant => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("participant")); } - request__ = map.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::Participant) + request__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::Participant) ; } GeneratedField::TrackComposite => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("trackComposite")); } - request__ = map.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::TrackComposite) + request__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::TrackComposite) ; } GeneratedField::Track => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("track")); } - request__ = map.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::Track) + request__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::Track) ; } GeneratedField::Stream => { if result__.is_some() { return Err(serde::de::Error::duplicate_field("stream")); } - result__ = map.next_value::<::std::option::Option<_>>()?.map(egress_info::Result::Stream) + result__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Result::Stream) ; } GeneratedField::File => { if result__.is_some() { return Err(serde::de::Error::duplicate_field("file")); } - result__ = map.next_value::<::std::option::Option<_>>()?.map(egress_info::Result::File) + result__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Result::File) ; } GeneratedField::Segments => { if result__.is_some() { return Err(serde::de::Error::duplicate_field("segments")); } - result__ = map.next_value::<::std::option::Option<_>>()?.map(egress_info::Result::Segments) + result__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Result::Segments) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -4153,10 +4142,9 @@ impl<'de> serde::Deserialize<'de> for EgressStatus { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(EgressStatus::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -4166,10 +4154,9 @@ impl<'de> serde::Deserialize<'de> for EgressStatus { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(EgressStatus::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -4216,8 +4203,8 @@ impl serde::Serialize for EncodedFileOutput { } let mut struct_ser = serializer.serialize_struct("livekit.EncodedFileOutput", len)?; if self.file_type != 0 { - let v = EncodedFileType::from_i32(self.file_type) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.file_type)))?; + let v = EncodedFileType::try_from(self.file_type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.file_type)))?; struct_ser.serialize_field("fileType", &v)?; } if !self.filepath.is_empty() { @@ -4316,7 +4303,7 @@ impl<'de> serde::Deserialize<'de> for EncodedFileOutput { formatter.write_str("struct livekit.EncodedFileOutput") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -4324,56 +4311,56 @@ impl<'de> serde::Deserialize<'de> for EncodedFileOutput { let mut filepath__ = None; let mut disable_manifest__ = None; let mut output__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::FileType => { if file_type__.is_some() { return Err(serde::de::Error::duplicate_field("fileType")); } - file_type__ = Some(map.next_value::()? as i32); + file_type__ = Some(map_.next_value::()? as i32); } GeneratedField::Filepath => { if filepath__.is_some() { return Err(serde::de::Error::duplicate_field("filepath")); } - filepath__ = Some(map.next_value()?); + filepath__ = Some(map_.next_value()?); } GeneratedField::DisableManifest => { if disable_manifest__.is_some() { return Err(serde::de::Error::duplicate_field("disableManifest")); } - disable_manifest__ = Some(map.next_value()?); + disable_manifest__ = Some(map_.next_value()?); } GeneratedField::S3 => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("s3")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(encoded_file_output::Output::S3) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(encoded_file_output::Output::S3) ; } GeneratedField::Gcp => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("gcp")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(encoded_file_output::Output::Gcp) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(encoded_file_output::Output::Gcp) ; } GeneratedField::Azure => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("azure")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(encoded_file_output::Output::Azure) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(encoded_file_output::Output::Azure) ; } GeneratedField::AliOss => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("aliOSS")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(encoded_file_output::Output::AliOss) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(encoded_file_output::Output::AliOss) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -4427,10 +4414,9 @@ impl<'de> serde::Deserialize<'de> for EncodedFileType { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(EncodedFileType::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -4440,10 +4426,9 @@ impl<'de> serde::Deserialize<'de> for EncodedFileType { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(EncodedFileType::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -4522,8 +4507,8 @@ impl serde::Serialize for EncodingOptions { struct_ser.serialize_field("framerate", &self.framerate)?; } if self.audio_codec != 0 { - let v = AudioCodec::from_i32(self.audio_codec) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.audio_codec)))?; + let v = AudioCodec::try_from(self.audio_codec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.audio_codec)))?; struct_ser.serialize_field("audioCodec", &v)?; } if self.audio_bitrate != 0 { @@ -4536,8 +4521,8 @@ impl serde::Serialize for EncodingOptions { struct_ser.serialize_field("audioFrequency", &self.audio_frequency)?; } if self.video_codec != 0 { - let v = VideoCodec::from_i32(self.video_codec) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.video_codec)))?; + let v = VideoCodec::try_from(self.video_codec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.video_codec)))?; struct_ser.serialize_field("videoCodec", &v)?; } if self.video_bitrate != 0 { @@ -4644,7 +4629,7 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { formatter.write_str("struct livekit.EncodingOptions") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -4660,14 +4645,14 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { let mut video_bitrate__ = None; let mut video_quality__ = None; let mut key_frame_interval__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Width => { if width__.is_some() { return Err(serde::de::Error::duplicate_field("width")); } width__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Height => { @@ -4675,7 +4660,7 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { return Err(serde::de::Error::duplicate_field("height")); } height__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Depth => { @@ -4683,7 +4668,7 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { return Err(serde::de::Error::duplicate_field("depth")); } depth__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Framerate => { @@ -4691,21 +4676,21 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { return Err(serde::de::Error::duplicate_field("framerate")); } framerate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::AudioCodec => { if audio_codec__.is_some() { return Err(serde::de::Error::duplicate_field("audioCodec")); } - audio_codec__ = Some(map.next_value::()? as i32); + audio_codec__ = Some(map_.next_value::()? as i32); } GeneratedField::AudioBitrate => { if audio_bitrate__.is_some() { return Err(serde::de::Error::duplicate_field("audioBitrate")); } audio_bitrate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::AudioQuality => { @@ -4713,7 +4698,7 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { return Err(serde::de::Error::duplicate_field("audioQuality")); } audio_quality__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::AudioFrequency => { @@ -4721,21 +4706,21 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { return Err(serde::de::Error::duplicate_field("audioFrequency")); } audio_frequency__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::VideoCodec => { if video_codec__.is_some() { return Err(serde::de::Error::duplicate_field("videoCodec")); } - video_codec__ = Some(map.next_value::()? as i32); + video_codec__ = Some(map_.next_value::()? as i32); } GeneratedField::VideoBitrate => { if video_bitrate__.is_some() { return Err(serde::de::Error::duplicate_field("videoBitrate")); } video_bitrate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::VideoQuality => { @@ -4743,7 +4728,7 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { return Err(serde::de::Error::duplicate_field("videoQuality")); } video_quality__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::KeyFrameInterval => { @@ -4751,11 +4736,11 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { return Err(serde::de::Error::duplicate_field("keyFrameInterval")); } key_frame_interval__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -4827,10 +4812,9 @@ impl<'de> serde::Deserialize<'de> for EncodingOptionsPreset { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(EncodingOptionsPreset::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -4840,10 +4824,9 @@ impl<'de> serde::Deserialize<'de> for EncodingOptionsPreset { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(EncodingOptionsPreset::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -4927,12 +4910,12 @@ impl<'de> serde::Deserialize<'de> for Encryption { formatter.write_str("struct livekit.Encryption") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - while map.next_key::()?.is_some() { - let _ = map.next_value::()?; + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } Ok(Encryption { }) @@ -4980,10 +4963,9 @@ impl<'de> serde::Deserialize<'de> for encryption::Type { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(encryption::Type::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -4993,10 +4975,9 @@ impl<'de> serde::Deserialize<'de> for encryption::Type { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(encryption::Type::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -5048,15 +5029,19 @@ impl serde::Serialize for FileInfo { struct_ser.serialize_field("filename", &self.filename)?; } if self.started_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } if self.duration != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; } if self.size != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("size", ToString::to_string(&self.size).as_str())?; } if !self.location.is_empty() { @@ -5133,7 +5118,7 @@ impl<'de> serde::Deserialize<'de> for FileInfo { formatter.write_str("struct livekit.FileInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -5143,20 +5128,20 @@ impl<'de> serde::Deserialize<'de> for FileInfo { let mut duration__ = None; let mut size__ = None; let mut location__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Filename => { if filename__.is_some() { return Err(serde::de::Error::duplicate_field("filename")); } - filename__ = Some(map.next_value()?); + filename__ = Some(map_.next_value()?); } GeneratedField::StartedAt => { if started_at__.is_some() { return Err(serde::de::Error::duplicate_field("startedAt")); } started_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::EndedAt => { @@ -5164,7 +5149,7 @@ impl<'de> serde::Deserialize<'de> for FileInfo { return Err(serde::de::Error::duplicate_field("endedAt")); } ended_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Duration => { @@ -5172,7 +5157,7 @@ impl<'de> serde::Deserialize<'de> for FileInfo { return Err(serde::de::Error::duplicate_field("duration")); } duration__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Size => { @@ -5180,17 +5165,17 @@ impl<'de> serde::Deserialize<'de> for FileInfo { return Err(serde::de::Error::duplicate_field("size")); } size__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Location => { if location__.is_some() { return Err(serde::de::Error::duplicate_field("location")); } - location__ = Some(map.next_value()?); + location__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -5285,28 +5270,28 @@ impl<'de> serde::Deserialize<'de> for GcpUpload { formatter.write_str("struct livekit.GCPUpload") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut credentials__ = None; let mut bucket__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Credentials => { if credentials__.is_some() { return Err(serde::de::Error::duplicate_field("credentials")); } - credentials__ = Some(map.next_value()?); + credentials__ = Some(map_.next_value()?); } GeneratedField::Bucket => { if bucket__.is_some() { return Err(serde::de::Error::duplicate_field("bucket")); } - bucket__ = Some(map.next_value()?); + bucket__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -5406,35 +5391,35 @@ impl<'de> serde::Deserialize<'de> for IceServer { formatter.write_str("struct livekit.ICEServer") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut urls__ = None; let mut username__ = None; let mut credential__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Urls => { if urls__.is_some() { return Err(serde::de::Error::duplicate_field("urls")); } - urls__ = Some(map.next_value()?); + urls__ = Some(map_.next_value()?); } GeneratedField::Username => { if username__.is_some() { return Err(serde::de::Error::duplicate_field("username")); } - username__ = Some(map.next_value()?); + username__ = Some(map_.next_value()?); } GeneratedField::Credential => { if credential__.is_some() { return Err(serde::de::Error::duplicate_field("credential")); } - credential__ = Some(map.next_value()?); + credential__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -5485,10 +5470,9 @@ impl<'de> serde::Deserialize<'de> for ImageCodec { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ImageCodec::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -5498,10 +5482,9 @@ impl<'de> serde::Deserialize<'de> for ImageCodec { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ImageCodec::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -5558,10 +5541,9 @@ impl<'de> serde::Deserialize<'de> for ImageFileSuffix { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ImageFileSuffix::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -5571,10 +5553,9 @@ impl<'de> serde::Deserialize<'de> for ImageFileSuffix { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ImageFileSuffix::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -5640,13 +5621,13 @@ impl serde::Serialize for ImageOutput { struct_ser.serialize_field("filenamePrefix", &self.filename_prefix)?; } if self.filename_suffix != 0 { - let v = ImageFileSuffix::from_i32(self.filename_suffix) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.filename_suffix)))?; + let v = ImageFileSuffix::try_from(self.filename_suffix) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.filename_suffix)))?; struct_ser.serialize_field("filenameSuffix", &v)?; } if self.image_codec != 0 { - let v = ImageCodec::from_i32(self.image_codec) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.image_codec)))?; + let v = ImageCodec::try_from(self.image_codec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.image_codec)))?; struct_ser.serialize_field("imageCodec", &v)?; } if self.disable_manifest { @@ -5757,7 +5738,7 @@ impl<'de> serde::Deserialize<'de> for ImageOutput { formatter.write_str("struct livekit.ImageOutput") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -5769,14 +5750,14 @@ impl<'de> serde::Deserialize<'de> for ImageOutput { let mut image_codec__ = None; let mut disable_manifest__ = None; let mut output__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::CaptureInterval => { if capture_interval__.is_some() { return Err(serde::de::Error::duplicate_field("captureInterval")); } capture_interval__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Width => { @@ -5784,7 +5765,7 @@ impl<'de> serde::Deserialize<'de> for ImageOutput { return Err(serde::de::Error::duplicate_field("width")); } width__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Height => { @@ -5792,63 +5773,63 @@ impl<'de> serde::Deserialize<'de> for ImageOutput { return Err(serde::de::Error::duplicate_field("height")); } height__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::FilenamePrefix => { if filename_prefix__.is_some() { return Err(serde::de::Error::duplicate_field("filenamePrefix")); } - filename_prefix__ = Some(map.next_value()?); + filename_prefix__ = Some(map_.next_value()?); } GeneratedField::FilenameSuffix => { if filename_suffix__.is_some() { return Err(serde::de::Error::duplicate_field("filenameSuffix")); } - filename_suffix__ = Some(map.next_value::()? as i32); + filename_suffix__ = Some(map_.next_value::()? as i32); } GeneratedField::ImageCodec => { if image_codec__.is_some() { return Err(serde::de::Error::duplicate_field("imageCodec")); } - image_codec__ = Some(map.next_value::()? as i32); + image_codec__ = Some(map_.next_value::()? as i32); } GeneratedField::DisableManifest => { if disable_manifest__.is_some() { return Err(serde::de::Error::duplicate_field("disableManifest")); } - disable_manifest__ = Some(map.next_value()?); + disable_manifest__ = Some(map_.next_value()?); } GeneratedField::S3 => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("s3")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(image_output::Output::S3) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::S3) ; } GeneratedField::Gcp => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("gcp")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(image_output::Output::Gcp) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::Gcp) ; } GeneratedField::Azure => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("azure")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(image_output::Output::Azure) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::Azure) ; } GeneratedField::AliOss => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("aliOSS")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(image_output::Output::AliOss) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::AliOss) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -5886,12 +5867,15 @@ impl serde::Serialize for ImagesInfo { } let mut struct_ser = serializer.serialize_struct("livekit.ImagesInfo", len)?; if self.image_count != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("imageCount", ToString::to_string(&self.image_count).as_str())?; } if self.started_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } struct_ser.end() @@ -5957,21 +5941,21 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { formatter.write_str("struct livekit.ImagesInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut image_count__ = None; let mut started_at__ = None; let mut ended_at__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::ImageCount => { if image_count__.is_some() { return Err(serde::de::Error::duplicate_field("imageCount")); } image_count__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::StartedAt => { @@ -5979,7 +5963,7 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { return Err(serde::de::Error::duplicate_field("startedAt")); } started_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::EndedAt => { @@ -5987,11 +5971,11 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { return Err(serde::de::Error::duplicate_field("endedAt")); } ended_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -6027,8 +6011,8 @@ impl serde::Serialize for IngressAudioEncodingOptions { } let mut struct_ser = serializer.serialize_struct("livekit.IngressAudioEncodingOptions", len)?; if self.audio_codec != 0 { - let v = AudioCodec::from_i32(self.audio_codec) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.audio_codec)))?; + let v = AudioCodec::try_from(self.audio_codec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.audio_codec)))?; struct_ser.serialize_field("audioCodec", &v)?; } if self.bitrate != 0 { @@ -6105,7 +6089,7 @@ impl<'de> serde::Deserialize<'de> for IngressAudioEncodingOptions { formatter.write_str("struct livekit.IngressAudioEncodingOptions") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -6113,38 +6097,38 @@ impl<'de> serde::Deserialize<'de> for IngressAudioEncodingOptions { let mut bitrate__ = None; let mut disable_dtx__ = None; let mut channels__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::AudioCodec => { if audio_codec__.is_some() { return Err(serde::de::Error::duplicate_field("audioCodec")); } - audio_codec__ = Some(map.next_value::()? as i32); + audio_codec__ = Some(map_.next_value::()? as i32); } GeneratedField::Bitrate => { if bitrate__.is_some() { return Err(serde::de::Error::duplicate_field("bitrate")); } bitrate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::DisableDtx => { if disable_dtx__.is_some() { return Err(serde::de::Error::duplicate_field("disableDtx")); } - disable_dtx__ = Some(map.next_value()?); + disable_dtx__ = Some(map_.next_value()?); } GeneratedField::Channels => { if channels__.is_some() { return Err(serde::de::Error::duplicate_field("channels")); } channels__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -6196,10 +6180,9 @@ impl<'de> serde::Deserialize<'de> for IngressAudioEncodingPreset { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(IngressAudioEncodingPreset::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -6209,10 +6192,9 @@ impl<'de> serde::Deserialize<'de> for IngressAudioEncodingPreset { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(IngressAudioEncodingPreset::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -6254,15 +6236,15 @@ impl serde::Serialize for IngressAudioOptions { struct_ser.serialize_field("name", &self.name)?; } if self.source != 0 { - let v = TrackSource::from_i32(self.source) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; + let v = TrackSource::try_from(self.source) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; struct_ser.serialize_field("source", &v)?; } if let Some(v) = self.encoding_options.as_ref() { match v { ingress_audio_options::EncodingOptions::Preset(v) => { - let v = IngressAudioEncodingPreset::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + let v = IngressAudioEncodingPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("preset", &v)?; } ingress_audio_options::EncodingOptions::Options(v) => { @@ -6333,42 +6315,42 @@ impl<'de> serde::Deserialize<'de> for IngressAudioOptions { formatter.write_str("struct livekit.IngressAudioOptions") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut name__ = None; let mut source__ = None; let mut encoding_options__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::Source => { if source__.is_some() { return Err(serde::de::Error::duplicate_field("source")); } - source__ = Some(map.next_value::()? as i32); + source__ = Some(map_.next_value::()? as i32); } GeneratedField::Preset => { if encoding_options__.is_some() { return Err(serde::de::Error::duplicate_field("preset")); } - encoding_options__ = map.next_value::<::std::option::Option>()?.map(|x| ingress_audio_options::EncodingOptions::Preset(x as i32)); + encoding_options__ = map_.next_value::<::std::option::Option>()?.map(|x| ingress_audio_options::EncodingOptions::Preset(x as i32)); } GeneratedField::Options => { if encoding_options__.is_some() { return Err(serde::de::Error::duplicate_field("options")); } - encoding_options__ = map.next_value::<::std::option::Option<_>>()?.map(ingress_audio_options::EncodingOptions::Options) + encoding_options__ = map_.next_value::<::std::option::Option<_>>()?.map(ingress_audio_options::EncodingOptions::Options) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -6443,8 +6425,8 @@ impl serde::Serialize for IngressInfo { struct_ser.serialize_field("url", &self.url)?; } if self.input_type != 0 { - let v = IngressInput::from_i32(self.input_type) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.input_type)))?; + let v = IngressInput::try_from(self.input_type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.input_type)))?; struct_ser.serialize_field("inputType", &v)?; } if self.bypass_transcoding { @@ -6568,7 +6550,7 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { formatter.write_str("struct livekit.IngressInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -6585,88 +6567,88 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { let mut participant_name__ = None; let mut reusable__ = None; let mut state__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::IngressId => { if ingress_id__.is_some() { return Err(serde::de::Error::duplicate_field("ingressId")); } - ingress_id__ = Some(map.next_value()?); + ingress_id__ = Some(map_.next_value()?); } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::StreamKey => { if stream_key__.is_some() { return Err(serde::de::Error::duplicate_field("streamKey")); } - stream_key__ = Some(map.next_value()?); + stream_key__ = Some(map_.next_value()?); } GeneratedField::Url => { if url__.is_some() { return Err(serde::de::Error::duplicate_field("url")); } - url__ = Some(map.next_value()?); + url__ = Some(map_.next_value()?); } GeneratedField::InputType => { if input_type__.is_some() { return Err(serde::de::Error::duplicate_field("inputType")); } - input_type__ = Some(map.next_value::()? as i32); + input_type__ = Some(map_.next_value::()? as i32); } GeneratedField::BypassTranscoding => { if bypass_transcoding__.is_some() { return Err(serde::de::Error::duplicate_field("bypassTranscoding")); } - bypass_transcoding__ = Some(map.next_value()?); + bypass_transcoding__ = Some(map_.next_value()?); } GeneratedField::Audio => { if audio__.is_some() { return Err(serde::de::Error::duplicate_field("audio")); } - audio__ = map.next_value()?; + audio__ = map_.next_value()?; } GeneratedField::Video => { if video__.is_some() { return Err(serde::de::Error::duplicate_field("video")); } - video__ = map.next_value()?; + video__ = map_.next_value()?; } GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::ParticipantIdentity => { if participant_identity__.is_some() { return Err(serde::de::Error::duplicate_field("participantIdentity")); } - participant_identity__ = Some(map.next_value()?); + participant_identity__ = Some(map_.next_value()?); } GeneratedField::ParticipantName => { if participant_name__.is_some() { return Err(serde::de::Error::duplicate_field("participantName")); } - participant_name__ = Some(map.next_value()?); + participant_name__ = Some(map_.next_value()?); } GeneratedField::Reusable => { if reusable__.is_some() { return Err(serde::de::Error::duplicate_field("reusable")); } - reusable__ = Some(map.next_value()?); + reusable__ = Some(map_.next_value()?); } GeneratedField::State => { if state__.is_some() { return Err(serde::de::Error::duplicate_field("state")); } - state__ = map.next_value()?; + state__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -6729,10 +6711,9 @@ impl<'de> serde::Deserialize<'de> for IngressInput { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(IngressInput::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -6742,10 +6723,9 @@ impl<'de> serde::Deserialize<'de> for IngressInput { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(IngressInput::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -6803,8 +6783,8 @@ impl serde::Serialize for IngressState { } let mut struct_ser = serializer.serialize_struct("livekit.IngressState", len)?; if self.status != 0 { - let v = ingress_state::Status::from_i32(self.status) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; + let v = ingress_state::Status::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; struct_ser.serialize_field("status", &v)?; } if !self.error.is_empty() { @@ -6820,9 +6800,11 @@ impl serde::Serialize for IngressState { struct_ser.serialize_field("roomId", &self.room_id)?; } if self.started_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } if !self.resource_id.is_empty() { @@ -6913,7 +6895,7 @@ impl<'de> serde::Deserialize<'de> for IngressState { formatter.write_str("struct livekit.IngressState") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -6926,44 +6908,44 @@ impl<'de> serde::Deserialize<'de> for IngressState { let mut ended_at__ = None; let mut resource_id__ = None; let mut tracks__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Status => { if status__.is_some() { return Err(serde::de::Error::duplicate_field("status")); } - status__ = Some(map.next_value::()? as i32); + status__ = Some(map_.next_value::()? as i32); } GeneratedField::Error => { if error__.is_some() { return Err(serde::de::Error::duplicate_field("error")); } - error__ = Some(map.next_value()?); + error__ = Some(map_.next_value()?); } GeneratedField::Video => { if video__.is_some() { return Err(serde::de::Error::duplicate_field("video")); } - video__ = map.next_value()?; + video__ = map_.next_value()?; } GeneratedField::Audio => { if audio__.is_some() { return Err(serde::de::Error::duplicate_field("audio")); } - audio__ = map.next_value()?; + audio__ = map_.next_value()?; } GeneratedField::RoomId => { if room_id__.is_some() { return Err(serde::de::Error::duplicate_field("roomId")); } - room_id__ = Some(map.next_value()?); + room_id__ = Some(map_.next_value()?); } GeneratedField::StartedAt => { if started_at__.is_some() { return Err(serde::de::Error::duplicate_field("startedAt")); } started_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::EndedAt => { @@ -6971,23 +6953,23 @@ impl<'de> serde::Deserialize<'de> for IngressState { return Err(serde::de::Error::duplicate_field("endedAt")); } ended_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::ResourceId => { if resource_id__.is_some() { return Err(serde::de::Error::duplicate_field("resourceId")); } - resource_id__ = Some(map.next_value()?); + resource_id__ = Some(map_.next_value()?); } GeneratedField::Tracks => { if tracks__.is_some() { return Err(serde::de::Error::duplicate_field("tracks")); } - tracks__ = Some(map.next_value()?); + tracks__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -7050,10 +7032,9 @@ impl<'de> serde::Deserialize<'de> for ingress_state::Status { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ingress_state::Status::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -7063,10 +7044,9 @@ impl<'de> serde::Deserialize<'de> for ingress_state::Status { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ingress_state::Status::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -7108,8 +7088,8 @@ impl serde::Serialize for IngressVideoEncodingOptions { } let mut struct_ser = serializer.serialize_struct("livekit.IngressVideoEncodingOptions", len)?; if self.video_codec != 0 { - let v = VideoCodec::from_i32(self.video_codec) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.video_codec)))?; + let v = VideoCodec::try_from(self.video_codec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.video_codec)))?; struct_ser.serialize_field("videoCodec", &v)?; } if self.frame_rate != 0. { @@ -7180,37 +7160,37 @@ impl<'de> serde::Deserialize<'de> for IngressVideoEncodingOptions { formatter.write_str("struct livekit.IngressVideoEncodingOptions") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut video_codec__ = None; let mut frame_rate__ = None; let mut layers__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::VideoCodec => { if video_codec__.is_some() { return Err(serde::de::Error::duplicate_field("videoCodec")); } - video_codec__ = Some(map.next_value::()? as i32); + video_codec__ = Some(map_.next_value::()? as i32); } GeneratedField::FrameRate => { if frame_rate__.is_some() { return Err(serde::de::Error::duplicate_field("frameRate")); } frame_rate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Layers => { if layers__.is_some() { return Err(serde::de::Error::duplicate_field("layers")); } - layers__ = Some(map.next_value()?); + layers__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -7277,10 +7257,9 @@ impl<'de> serde::Deserialize<'de> for IngressVideoEncodingPreset { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(IngressVideoEncodingPreset::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -7290,10 +7269,9 @@ impl<'de> serde::Deserialize<'de> for IngressVideoEncodingPreset { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(IngressVideoEncodingPreset::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -7343,15 +7321,15 @@ impl serde::Serialize for IngressVideoOptions { struct_ser.serialize_field("name", &self.name)?; } if self.source != 0 { - let v = TrackSource::from_i32(self.source) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; + let v = TrackSource::try_from(self.source) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; struct_ser.serialize_field("source", &v)?; } if let Some(v) = self.encoding_options.as_ref() { match v { ingress_video_options::EncodingOptions::Preset(v) => { - let v = IngressVideoEncodingPreset::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + let v = IngressVideoEncodingPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("preset", &v)?; } ingress_video_options::EncodingOptions::Options(v) => { @@ -7422,42 +7400,42 @@ impl<'de> serde::Deserialize<'de> for IngressVideoOptions { formatter.write_str("struct livekit.IngressVideoOptions") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut name__ = None; let mut source__ = None; let mut encoding_options__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::Source => { if source__.is_some() { return Err(serde::de::Error::duplicate_field("source")); } - source__ = Some(map.next_value::()? as i32); + source__ = Some(map_.next_value::()? as i32); } GeneratedField::Preset => { if encoding_options__.is_some() { return Err(serde::de::Error::duplicate_field("preset")); } - encoding_options__ = map.next_value::<::std::option::Option>()?.map(|x| ingress_video_options::EncodingOptions::Preset(x as i32)); + encoding_options__ = map_.next_value::<::std::option::Option>()?.map(|x| ingress_video_options::EncodingOptions::Preset(x as i32)); } GeneratedField::Options => { if encoding_options__.is_some() { return Err(serde::de::Error::duplicate_field("options")); } - encoding_options__ = map.next_value::<::std::option::Option<_>>()?.map(ingress_video_options::EncodingOptions::Options) + encoding_options__ = map_.next_value::<::std::option::Option<_>>()?.map(ingress_video_options::EncodingOptions::Options) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -7570,7 +7548,7 @@ impl<'de> serde::Deserialize<'de> for InputAudioState { formatter.write_str("struct livekit.InputAudioState") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -7578,20 +7556,20 @@ impl<'de> serde::Deserialize<'de> for InputAudioState { let mut average_bitrate__ = None; let mut channels__ = None; let mut sample_rate__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::MimeType => { if mime_type__.is_some() { return Err(serde::de::Error::duplicate_field("mimeType")); } - mime_type__ = Some(map.next_value()?); + mime_type__ = Some(map_.next_value()?); } GeneratedField::AverageBitrate => { if average_bitrate__.is_some() { return Err(serde::de::Error::duplicate_field("averageBitrate")); } average_bitrate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Channels => { @@ -7599,7 +7577,7 @@ impl<'de> serde::Deserialize<'de> for InputAudioState { return Err(serde::de::Error::duplicate_field("channels")); } channels__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::SampleRate => { @@ -7607,11 +7585,11 @@ impl<'de> serde::Deserialize<'de> for InputAudioState { return Err(serde::de::Error::duplicate_field("sampleRate")); } sample_rate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -7733,7 +7711,7 @@ impl<'de> serde::Deserialize<'de> for InputVideoState { formatter.write_str("struct livekit.InputVideoState") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -7742,20 +7720,20 @@ impl<'de> serde::Deserialize<'de> for InputVideoState { let mut width__ = None; let mut height__ = None; let mut framerate__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::MimeType => { if mime_type__.is_some() { return Err(serde::de::Error::duplicate_field("mimeType")); } - mime_type__ = Some(map.next_value()?); + mime_type__ = Some(map_.next_value()?); } GeneratedField::AverageBitrate => { if average_bitrate__.is_some() { return Err(serde::de::Error::duplicate_field("averageBitrate")); } average_bitrate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Width => { @@ -7763,7 +7741,7 @@ impl<'de> serde::Deserialize<'de> for InputVideoState { return Err(serde::de::Error::duplicate_field("width")); } width__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Height => { @@ -7771,7 +7749,7 @@ impl<'de> serde::Deserialize<'de> for InputVideoState { return Err(serde::de::Error::duplicate_field("height")); } height__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Framerate => { @@ -7779,11 +7757,11 @@ impl<'de> serde::Deserialize<'de> for InputVideoState { return Err(serde::de::Error::duplicate_field("framerate")); } framerate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -7884,6 +7862,7 @@ impl serde::Serialize for JoinResponse { struct_ser.serialize_field("serverInfo", v)?; } if !self.sif_trailer.is_empty() { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("sifTrailer", pbjson::private::base64::encode(&self.sif_trailer).as_str())?; } struct_ser.end() @@ -7987,7 +7966,7 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { formatter.write_str("struct livekit.JoinResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -8004,68 +7983,68 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { let mut ping_interval__ = None; let mut server_info__ = None; let mut sif_trailer__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = map.next_value()?; + room__ = map_.next_value()?; } GeneratedField::Participant => { if participant__.is_some() { return Err(serde::de::Error::duplicate_field("participant")); } - participant__ = map.next_value()?; + participant__ = map_.next_value()?; } GeneratedField::OtherParticipants => { if other_participants__.is_some() { return Err(serde::de::Error::duplicate_field("otherParticipants")); } - other_participants__ = Some(map.next_value()?); + other_participants__ = Some(map_.next_value()?); } GeneratedField::ServerVersion => { if server_version__.is_some() { return Err(serde::de::Error::duplicate_field("serverVersion")); } - server_version__ = Some(map.next_value()?); + server_version__ = Some(map_.next_value()?); } GeneratedField::IceServers => { if ice_servers__.is_some() { return Err(serde::de::Error::duplicate_field("iceServers")); } - ice_servers__ = Some(map.next_value()?); + ice_servers__ = Some(map_.next_value()?); } GeneratedField::SubscriberPrimary => { if subscriber_primary__.is_some() { return Err(serde::de::Error::duplicate_field("subscriberPrimary")); } - subscriber_primary__ = Some(map.next_value()?); + subscriber_primary__ = Some(map_.next_value()?); } GeneratedField::AlternativeUrl => { if alternative_url__.is_some() { return Err(serde::de::Error::duplicate_field("alternativeUrl")); } - alternative_url__ = Some(map.next_value()?); + alternative_url__ = Some(map_.next_value()?); } GeneratedField::ClientConfiguration => { if client_configuration__.is_some() { return Err(serde::de::Error::duplicate_field("clientConfiguration")); } - client_configuration__ = map.next_value()?; + client_configuration__ = map_.next_value()?; } GeneratedField::ServerRegion => { if server_region__.is_some() { return Err(serde::de::Error::duplicate_field("serverRegion")); } - server_region__ = Some(map.next_value()?); + server_region__ = Some(map_.next_value()?); } GeneratedField::PingTimeout => { if ping_timeout__.is_some() { return Err(serde::de::Error::duplicate_field("pingTimeout")); } ping_timeout__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PingInterval => { @@ -8073,25 +8052,25 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { return Err(serde::de::Error::duplicate_field("pingInterval")); } ping_interval__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::ServerInfo => { if server_info__.is_some() { return Err(serde::de::Error::duplicate_field("serverInfo")); } - server_info__ = map.next_value()?; + server_info__ = map_.next_value()?; } GeneratedField::SifTrailer => { if sif_trailer__.is_some() { return Err(serde::de::Error::duplicate_field("sifTrailer")); } sif_trailer__ = - Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -8134,8 +8113,8 @@ impl serde::Serialize for LeaveRequest { struct_ser.serialize_field("canReconnect", &self.can_reconnect)?; } if self.reason != 0 { - let v = DisconnectReason::from_i32(self.reason) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.reason)))?; + let v = DisconnectReason::try_from(self.reason) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.reason)))?; struct_ser.serialize_field("reason", &v)?; } struct_ser.end() @@ -8196,28 +8175,28 @@ impl<'de> serde::Deserialize<'de> for LeaveRequest { formatter.write_str("struct livekit.LeaveRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut can_reconnect__ = None; let mut reason__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::CanReconnect => { if can_reconnect__.is_some() { return Err(serde::de::Error::duplicate_field("canReconnect")); } - can_reconnect__ = Some(map.next_value()?); + can_reconnect__ = Some(map_.next_value()?); } GeneratedField::Reason => { if reason__.is_some() { return Err(serde::de::Error::duplicate_field("reason")); } - reason__ = Some(map.next_value::()? as i32); + reason__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -8319,35 +8298,35 @@ impl<'de> serde::Deserialize<'de> for ListEgressRequest { formatter.write_str("struct livekit.ListEgressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room_name__ = None; let mut egress_id__ = None; let mut active__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::EgressId => { if egress_id__.is_some() { return Err(serde::de::Error::duplicate_field("egressId")); } - egress_id__ = Some(map.next_value()?); + egress_id__ = Some(map_.next_value()?); } GeneratedField::Active => { if active__.is_some() { return Err(serde::de::Error::duplicate_field("active")); } - active__ = Some(map.next_value()?); + active__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -8430,21 +8409,21 @@ impl<'de> serde::Deserialize<'de> for ListEgressResponse { formatter.write_str("struct livekit.ListEgressResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut items__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Items => { if items__.is_some() { return Err(serde::de::Error::duplicate_field("items")); } - items__ = Some(map.next_value()?); + items__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -8536,28 +8515,28 @@ impl<'de> serde::Deserialize<'de> for ListIngressRequest { formatter.write_str("struct livekit.ListIngressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room_name__ = None; let mut ingress_id__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::IngressId => { if ingress_id__.is_some() { return Err(serde::de::Error::duplicate_field("ingressId")); } - ingress_id__ = Some(map.next_value()?); + ingress_id__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -8639,21 +8618,21 @@ impl<'de> serde::Deserialize<'de> for ListIngressResponse { formatter.write_str("struct livekit.ListIngressResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut items__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Items => { if items__.is_some() { return Err(serde::de::Error::duplicate_field("items")); } - items__ = Some(map.next_value()?); + items__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -8734,21 +8713,21 @@ impl<'de> serde::Deserialize<'de> for ListParticipantsRequest { formatter.write_str("struct livekit.ListParticipantsRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -8829,21 +8808,21 @@ impl<'de> serde::Deserialize<'de> for ListParticipantsResponse { formatter.write_str("struct livekit.ListParticipantsResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut participants__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Participants => { if participants__.is_some() { return Err(serde::de::Error::duplicate_field("participants")); } - participants__ = Some(map.next_value()?); + participants__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -8924,21 +8903,21 @@ impl<'de> serde::Deserialize<'de> for ListRoomsRequest { formatter.write_str("struct livekit.ListRoomsRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut names__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Names => { if names__.is_some() { return Err(serde::de::Error::duplicate_field("names")); } - names__ = Some(map.next_value()?); + names__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -9019,21 +8998,21 @@ impl<'de> serde::Deserialize<'de> for ListRoomsResponse { formatter.write_str("struct livekit.ListRoomsResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut rooms__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Rooms => { if rooms__.is_some() { return Err(serde::de::Error::duplicate_field("rooms")); } - rooms__ = Some(map.next_value()?); + rooms__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -9142,7 +9121,7 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { formatter.write_str("struct livekit.MuteRoomTrackRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -9150,34 +9129,34 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { let mut identity__ = None; let mut track_sid__ = None; let mut muted__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::Identity => { if identity__.is_some() { return Err(serde::de::Error::duplicate_field("identity")); } - identity__ = Some(map.next_value()?); + identity__ = Some(map_.next_value()?); } GeneratedField::TrackSid => { if track_sid__.is_some() { return Err(serde::de::Error::duplicate_field("trackSid")); } - track_sid__ = Some(map.next_value()?); + track_sid__ = Some(map_.next_value()?); } GeneratedField::Muted => { if muted__.is_some() { return Err(serde::de::Error::duplicate_field("muted")); } - muted__ = Some(map.next_value()?); + muted__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -9261,21 +9240,21 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackResponse { formatter.write_str("struct livekit.MuteRoomTrackResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut track__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Track => { if track__.is_some() { return Err(serde::de::Error::duplicate_field("track")); } - track__ = map.next_value()?; + track__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -9365,28 +9344,28 @@ impl<'de> serde::Deserialize<'de> for MuteTrackRequest { formatter.write_str("struct livekit.MuteTrackRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut sid__ = None; let mut muted__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Sid => { if sid__.is_some() { return Err(serde::de::Error::duplicate_field("sid")); } - sid__ = Some(map.next_value()?); + sid__ = Some(map_.next_value()?); } GeneratedField::Muted => { if muted__.is_some() { return Err(serde::de::Error::duplicate_field("muted")); } - muted__ = Some(map.next_value()?); + muted__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -9456,8 +9435,8 @@ impl serde::Serialize for ParticipantEgressRequest { if let Some(v) = self.options.as_ref() { match v { participant_egress_request::Options::Preset(v) => { - let v = EncodingOptionsPreset::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + let v = EncodingOptionsPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("preset", &v)?; } participant_egress_request::Options::Advanced(v) => { @@ -9549,7 +9528,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantEgressRequest { formatter.write_str("struct livekit.ParticipantEgressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -9561,65 +9540,65 @@ impl<'de> serde::Deserialize<'de> for ParticipantEgressRequest { let mut segment_outputs__ = None; let mut image_outputs__ = None; let mut options__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::Identity => { if identity__.is_some() { return Err(serde::de::Error::duplicate_field("identity")); } - identity__ = Some(map.next_value()?); + identity__ = Some(map_.next_value()?); } GeneratedField::ScreenShare => { if screen_share__.is_some() { return Err(serde::de::Error::duplicate_field("screenShare")); } - screen_share__ = Some(map.next_value()?); + screen_share__ = Some(map_.next_value()?); } GeneratedField::FileOutputs => { if file_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("fileOutputs")); } - file_outputs__ = Some(map.next_value()?); + file_outputs__ = Some(map_.next_value()?); } GeneratedField::StreamOutputs => { if stream_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("streamOutputs")); } - stream_outputs__ = Some(map.next_value()?); + stream_outputs__ = Some(map_.next_value()?); } GeneratedField::SegmentOutputs => { if segment_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("segmentOutputs")); } - segment_outputs__ = Some(map.next_value()?); + segment_outputs__ = Some(map_.next_value()?); } GeneratedField::ImageOutputs => { if image_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("imageOutputs")); } - image_outputs__ = Some(map.next_value()?); + image_outputs__ = Some(map_.next_value()?); } GeneratedField::Preset => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("preset")); } - options__ = map.next_value::<::std::option::Option>()?.map(|x| participant_egress_request::Options::Preset(x as i32)); + options__ = map_.next_value::<::std::option::Option>()?.map(|x| participant_egress_request::Options::Preset(x as i32)); } GeneratedField::Advanced => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("advanced")); } - options__ = map.next_value::<::std::option::Option<_>>()?.map(participant_egress_request::Options::Advanced) + options__ = map_.next_value::<::std::option::Option<_>>()?.map(participant_egress_request::Options::Advanced) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -9690,8 +9669,8 @@ impl serde::Serialize for ParticipantInfo { struct_ser.serialize_field("identity", &self.identity)?; } if self.state != 0 { - let v = participant_info::State::from_i32(self.state) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; + let v = participant_info::State::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; struct_ser.serialize_field("state", &v)?; } if !self.tracks.is_empty() { @@ -9701,6 +9680,7 @@ impl serde::Serialize for ParticipantInfo { struct_ser.serialize_field("metadata", &self.metadata)?; } if self.joined_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("joinedAt", ToString::to_string(&self.joined_at).as_str())?; } if !self.name.is_empty() { @@ -9719,8 +9699,8 @@ impl serde::Serialize for ParticipantInfo { struct_ser.serialize_field("isPublisher", &self.is_publisher)?; } if self.kind != 0 { - let v = participant_info::Kind::from_i32(self.kind) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; + let v = participant_info::Kind::try_from(self.kind) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; struct_ser.serialize_field("kind", &v)?; } struct_ser.end() @@ -9812,7 +9792,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantInfo { formatter.write_str("struct livekit.ParticipantInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -9828,86 +9808,86 @@ impl<'de> serde::Deserialize<'de> for ParticipantInfo { let mut region__ = None; let mut is_publisher__ = None; let mut kind__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Sid => { if sid__.is_some() { return Err(serde::de::Error::duplicate_field("sid")); } - sid__ = Some(map.next_value()?); + sid__ = Some(map_.next_value()?); } GeneratedField::Identity => { if identity__.is_some() { return Err(serde::de::Error::duplicate_field("identity")); } - identity__ = Some(map.next_value()?); + identity__ = Some(map_.next_value()?); } GeneratedField::State => { if state__.is_some() { return Err(serde::de::Error::duplicate_field("state")); } - state__ = Some(map.next_value::()? as i32); + state__ = Some(map_.next_value::()? as i32); } GeneratedField::Tracks => { if tracks__.is_some() { return Err(serde::de::Error::duplicate_field("tracks")); } - tracks__ = Some(map.next_value()?); + tracks__ = Some(map_.next_value()?); } GeneratedField::Metadata => { if metadata__.is_some() { return Err(serde::de::Error::duplicate_field("metadata")); } - metadata__ = Some(map.next_value()?); + metadata__ = Some(map_.next_value()?); } GeneratedField::JoinedAt => { if joined_at__.is_some() { return Err(serde::de::Error::duplicate_field("joinedAt")); } joined_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::Version => { if version__.is_some() { return Err(serde::de::Error::duplicate_field("version")); } version__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Permission => { if permission__.is_some() { return Err(serde::de::Error::duplicate_field("permission")); } - permission__ = map.next_value()?; + permission__ = map_.next_value()?; } GeneratedField::Region => { if region__.is_some() { return Err(serde::de::Error::duplicate_field("region")); } - region__ = Some(map.next_value()?); + region__ = Some(map_.next_value()?); } GeneratedField::IsPublisher => { if is_publisher__.is_some() { return Err(serde::de::Error::duplicate_field("isPublisher")); } - is_publisher__ = Some(map.next_value()?); + is_publisher__ = Some(map_.next_value()?); } GeneratedField::Kind => { if kind__.is_some() { return Err(serde::de::Error::duplicate_field("kind")); } - kind__ = Some(map.next_value::()? as i32); + kind__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -9973,10 +9953,9 @@ impl<'de> serde::Deserialize<'de> for participant_info::Kind { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(participant_info::Kind::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -9986,10 +9965,9 @@ impl<'de> serde::Deserialize<'de> for participant_info::Kind { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(participant_info::Kind::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -10053,10 +10031,9 @@ impl<'de> serde::Deserialize<'de> for participant_info::State { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(participant_info::State::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -10066,10 +10043,9 @@ impl<'de> serde::Deserialize<'de> for participant_info::State { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(participant_info::State::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -10135,8 +10111,8 @@ impl serde::Serialize for ParticipantPermission { } if !self.can_publish_sources.is_empty() { let v = self.can_publish_sources.iter().cloned().map(|v| { - TrackSource::from_i32(v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", v))) + TrackSource::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) }).collect::, _>>()?; struct_ser.serialize_field("canPublishSources", &v)?; } @@ -10232,7 +10208,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { formatter.write_str("struct livekit.ParticipantPermission") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -10244,58 +10220,58 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { let mut recorder__ = None; let mut can_update_metadata__ = None; let mut agent__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::CanSubscribe => { if can_subscribe__.is_some() { return Err(serde::de::Error::duplicate_field("canSubscribe")); } - can_subscribe__ = Some(map.next_value()?); + can_subscribe__ = Some(map_.next_value()?); } GeneratedField::CanPublish => { if can_publish__.is_some() { return Err(serde::de::Error::duplicate_field("canPublish")); } - can_publish__ = Some(map.next_value()?); + can_publish__ = Some(map_.next_value()?); } GeneratedField::CanPublishData => { if can_publish_data__.is_some() { return Err(serde::de::Error::duplicate_field("canPublishData")); } - can_publish_data__ = Some(map.next_value()?); + can_publish_data__ = Some(map_.next_value()?); } GeneratedField::CanPublishSources => { if can_publish_sources__.is_some() { return Err(serde::de::Error::duplicate_field("canPublishSources")); } - can_publish_sources__ = Some(map.next_value::>()?.into_iter().map(|x| x as i32).collect()); + can_publish_sources__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); } GeneratedField::Hidden => { if hidden__.is_some() { return Err(serde::de::Error::duplicate_field("hidden")); } - hidden__ = Some(map.next_value()?); + hidden__ = Some(map_.next_value()?); } GeneratedField::Recorder => { if recorder__.is_some() { return Err(serde::de::Error::duplicate_field("recorder")); } - recorder__ = Some(map.next_value()?); + recorder__ = Some(map_.next_value()?); } GeneratedField::CanUpdateMetadata => { if can_update_metadata__.is_some() { return Err(serde::de::Error::duplicate_field("canUpdateMetadata")); } - can_update_metadata__ = Some(map.next_value()?); + can_update_metadata__ = Some(map_.next_value()?); } GeneratedField::Agent => { if agent__.is_some() { return Err(serde::de::Error::duplicate_field("agent")); } - agent__ = Some(map.next_value()?); + agent__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -10394,28 +10370,28 @@ impl<'de> serde::Deserialize<'de> for ParticipantTracks { formatter.write_str("struct livekit.ParticipantTracks") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut participant_sid__ = None; let mut track_sids__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::ParticipantSid => { if participant_sid__.is_some() { return Err(serde::de::Error::duplicate_field("participantSid")); } - participant_sid__ = Some(map.next_value()?); + participant_sid__ = Some(map_.next_value()?); } GeneratedField::TrackSids => { if track_sids__.is_some() { return Err(serde::de::Error::duplicate_field("trackSids")); } - track_sids__ = Some(map.next_value()?); + track_sids__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -10497,21 +10473,21 @@ impl<'de> serde::Deserialize<'de> for ParticipantUpdate { formatter.write_str("struct livekit.ParticipantUpdate") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut participants__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Participants => { if participants__.is_some() { return Err(serde::de::Error::duplicate_field("participants")); } - participants__ = Some(map.next_value()?); + participants__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -10539,9 +10515,11 @@ impl serde::Serialize for Ping { } let mut struct_ser = serializer.serialize_struct("livekit.Ping", len)?; if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; } if self.rtt != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("rtt", ToString::to_string(&self.rtt).as_str())?; } struct_ser.end() @@ -10601,20 +10579,20 @@ impl<'de> serde::Deserialize<'de> for Ping { formatter.write_str("struct livekit.Ping") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut timestamp__ = None; let mut rtt__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Timestamp => { if timestamp__.is_some() { return Err(serde::de::Error::duplicate_field("timestamp")); } timestamp__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Rtt => { @@ -10622,11 +10600,11 @@ impl<'de> serde::Deserialize<'de> for Ping { return Err(serde::de::Error::duplicate_field("rtt")); } rtt__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -10726,27 +10704,27 @@ impl<'de> serde::Deserialize<'de> for PlayoutDelay { formatter.write_str("struct livekit.PlayoutDelay") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut enabled__ = None; let mut min__ = None; let mut max__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Enabled => { if enabled__.is_some() { return Err(serde::de::Error::duplicate_field("enabled")); } - enabled__ = Some(map.next_value()?); + enabled__ = Some(map_.next_value()?); } GeneratedField::Min => { if min__.is_some() { return Err(serde::de::Error::duplicate_field("min")); } min__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Max => { @@ -10754,11 +10732,11 @@ impl<'de> serde::Deserialize<'de> for PlayoutDelay { return Err(serde::de::Error::duplicate_field("max")); } max__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -10788,9 +10766,11 @@ impl serde::Serialize for Pong { } let mut struct_ser = serializer.serialize_struct("livekit.Pong", len)?; if self.last_ping_timestamp != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("lastPingTimestamp", ToString::to_string(&self.last_ping_timestamp).as_str())?; } if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; } struct_ser.end() @@ -10851,20 +10831,20 @@ impl<'de> serde::Deserialize<'de> for Pong { formatter.write_str("struct livekit.Pong") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut last_ping_timestamp__ = None; let mut timestamp__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::LastPingTimestamp => { if last_ping_timestamp__.is_some() { return Err(serde::de::Error::duplicate_field("lastPingTimestamp")); } last_ping_timestamp__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Timestamp => { @@ -10872,11 +10852,11 @@ impl<'de> serde::Deserialize<'de> for Pong { return Err(serde::de::Error::duplicate_field("timestamp")); } timestamp__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -10935,15 +10915,19 @@ impl serde::Serialize for RtpDrift { struct_ser.serialize_field("duration", &self.duration)?; } if self.start_timestamp != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("startTimestamp", ToString::to_string(&self.start_timestamp).as_str())?; } if self.end_timestamp != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("endTimestamp", ToString::to_string(&self.end_timestamp).as_str())?; } if self.rtp_clock_ticks != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("rtpClockTicks", ToString::to_string(&self.rtp_clock_ticks).as_str())?; } if self.drift_samples != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("driftSamples", ToString::to_string(&self.drift_samples).as_str())?; } if self.drift_ms != 0. { @@ -11038,7 +11022,7 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { formatter.write_str("struct livekit.RTPDrift") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -11051,26 +11035,26 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { let mut drift_samples__ = None; let mut drift_ms__ = None; let mut clock_rate__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::StartTime => { if start_time__.is_some() { return Err(serde::de::Error::duplicate_field("startTime")); } - start_time__ = map.next_value()?; + start_time__ = map_.next_value()?; } GeneratedField::EndTime => { if end_time__.is_some() { return Err(serde::de::Error::duplicate_field("endTime")); } - end_time__ = map.next_value()?; + end_time__ = map_.next_value()?; } GeneratedField::Duration => { if duration__.is_some() { return Err(serde::de::Error::duplicate_field("duration")); } duration__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::StartTimestamp => { @@ -11078,7 +11062,7 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { return Err(serde::de::Error::duplicate_field("startTimestamp")); } start_timestamp__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::EndTimestamp => { @@ -11086,7 +11070,7 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { return Err(serde::de::Error::duplicate_field("endTimestamp")); } end_timestamp__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::RtpClockTicks => { @@ -11094,7 +11078,7 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { return Err(serde::de::Error::duplicate_field("rtpClockTicks")); } rtp_clock_ticks__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::DriftSamples => { @@ -11102,7 +11086,7 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { return Err(serde::de::Error::duplicate_field("driftSamples")); } drift_samples__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::DriftMs => { @@ -11110,7 +11094,7 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { return Err(serde::de::Error::duplicate_field("driftMs")); } drift_ms__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::ClockRate => { @@ -11118,11 +11102,11 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { return Err(serde::de::Error::duplicate_field("clockRate")); } clock_rate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -11296,9 +11280,11 @@ impl serde::Serialize for RtpStats { struct_ser.serialize_field("packetRate", &self.packet_rate)?; } if self.bytes != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("bytes", ToString::to_string(&self.bytes).as_str())?; } if self.header_bytes != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("headerBytes", ToString::to_string(&self.header_bytes).as_str())?; } if self.bitrate != 0. { @@ -11320,9 +11306,11 @@ impl serde::Serialize for RtpStats { struct_ser.serialize_field("packetDuplicateRate", &self.packet_duplicate_rate)?; } if self.bytes_duplicate != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("bytesDuplicate", ToString::to_string(&self.bytes_duplicate).as_str())?; } if self.header_bytes_duplicate != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("headerBytesDuplicate", ToString::to_string(&self.header_bytes_duplicate).as_str())?; } if self.bitrate_duplicate != 0. { @@ -11335,9 +11323,11 @@ impl serde::Serialize for RtpStats { struct_ser.serialize_field("packetPaddingRate", &self.packet_padding_rate)?; } if self.bytes_padding != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("bytesPadding", ToString::to_string(&self.bytes_padding).as_str())?; } if self.header_bytes_padding != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("headerBytesPadding", ToString::to_string(&self.header_bytes_padding).as_str())?; } if self.bitrate_padding != 0. { @@ -11624,7 +11614,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { formatter.write_str("struct livekit.RTPStats") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -11671,26 +11661,26 @@ impl<'de> serde::Deserialize<'de> for RtpStats { let mut last_layer_lock_pli__ = None; let mut packet_drift__ = None; let mut report_drift__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::StartTime => { if start_time__.is_some() { return Err(serde::de::Error::duplicate_field("startTime")); } - start_time__ = map.next_value()?; + start_time__ = map_.next_value()?; } GeneratedField::EndTime => { if end_time__.is_some() { return Err(serde::de::Error::duplicate_field("endTime")); } - end_time__ = map.next_value()?; + end_time__ = map_.next_value()?; } GeneratedField::Duration => { if duration__.is_some() { return Err(serde::de::Error::duplicate_field("duration")); } duration__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Packets => { @@ -11698,7 +11688,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packets")); } packets__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketRate => { @@ -11706,7 +11696,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetRate")); } packet_rate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Bytes => { @@ -11714,7 +11704,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("bytes")); } bytes__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::HeaderBytes => { @@ -11722,7 +11712,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("headerBytes")); } header_bytes__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Bitrate => { @@ -11730,7 +11720,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("bitrate")); } bitrate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketsLost => { @@ -11738,7 +11728,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetsLost")); } packets_lost__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketLossRate => { @@ -11746,7 +11736,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetLossRate")); } packet_loss_rate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketLossPercentage => { @@ -11754,7 +11744,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetLossPercentage")); } packet_loss_percentage__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketsDuplicate => { @@ -11762,7 +11752,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetsDuplicate")); } packets_duplicate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketDuplicateRate => { @@ -11770,7 +11760,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetDuplicateRate")); } packet_duplicate_rate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::BytesDuplicate => { @@ -11778,7 +11768,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("bytesDuplicate")); } bytes_duplicate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::HeaderBytesDuplicate => { @@ -11786,7 +11776,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("headerBytesDuplicate")); } header_bytes_duplicate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::BitrateDuplicate => { @@ -11794,7 +11784,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("bitrateDuplicate")); } bitrate_duplicate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketsPadding => { @@ -11802,7 +11792,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetsPadding")); } packets_padding__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketPaddingRate => { @@ -11810,7 +11800,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetPaddingRate")); } packet_padding_rate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::BytesPadding => { @@ -11818,7 +11808,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("bytesPadding")); } bytes_padding__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::HeaderBytesPadding => { @@ -11826,7 +11816,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("headerBytesPadding")); } header_bytes_padding__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::BitratePadding => { @@ -11834,7 +11824,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("bitratePadding")); } bitrate_padding__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PacketsOutOfOrder => { @@ -11842,7 +11832,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("packetsOutOfOrder")); } packets_out_of_order__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Frames => { @@ -11850,7 +11840,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("frames")); } frames__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::FrameRate => { @@ -11858,7 +11848,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("frameRate")); } frame_rate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::JitterCurrent => { @@ -11866,7 +11856,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("jitterCurrent")); } jitter_current__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::JitterMax => { @@ -11874,7 +11864,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("jitterMax")); } jitter_max__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::GapHistogram => { @@ -11882,7 +11872,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("gapHistogram")); } gap_histogram__ = Some( - map.next_value::, ::pbjson::private::NumberDeserialize>>()? + map_.next_value::, ::pbjson::private::NumberDeserialize>>()? .into_iter().map(|(k,v)| (k.0, v.0)).collect() ); } @@ -11891,7 +11881,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("nacks")); } nacks__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::NackAcks => { @@ -11899,7 +11889,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("nackAcks")); } nack_acks__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::NackMisses => { @@ -11907,7 +11897,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("nackMisses")); } nack_misses__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::NackRepeated => { @@ -11915,7 +11905,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("nackRepeated")); } nack_repeated__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Plis => { @@ -11923,35 +11913,35 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("plis")); } plis__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::LastPli => { if last_pli__.is_some() { return Err(serde::de::Error::duplicate_field("lastPli")); } - last_pli__ = map.next_value()?; + last_pli__ = map_.next_value()?; } GeneratedField::Firs => { if firs__.is_some() { return Err(serde::de::Error::duplicate_field("firs")); } firs__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::LastFir => { if last_fir__.is_some() { return Err(serde::de::Error::duplicate_field("lastFir")); } - last_fir__ = map.next_value()?; + last_fir__ = map_.next_value()?; } GeneratedField::RttCurrent => { if rtt_current__.is_some() { return Err(serde::de::Error::duplicate_field("rttCurrent")); } rtt_current__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::RttMax => { @@ -11959,7 +11949,7 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("rttMax")); } rtt_max__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::KeyFrames => { @@ -11967,43 +11957,43 @@ impl<'de> serde::Deserialize<'de> for RtpStats { return Err(serde::de::Error::duplicate_field("keyFrames")); } key_frames__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::LastKeyFrame => { if last_key_frame__.is_some() { return Err(serde::de::Error::duplicate_field("lastKeyFrame")); } - last_key_frame__ = map.next_value()?; + last_key_frame__ = map_.next_value()?; } GeneratedField::LayerLockPlis => { if layer_lock_plis__.is_some() { return Err(serde::de::Error::duplicate_field("layerLockPlis")); } layer_lock_plis__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::LastLayerLockPli => { if last_layer_lock_pli__.is_some() { return Err(serde::de::Error::duplicate_field("lastLayerLockPli")); } - last_layer_lock_pli__ = map.next_value()?; + last_layer_lock_pli__ = map_.next_value()?; } GeneratedField::PacketDrift => { if packet_drift__.is_some() { return Err(serde::de::Error::duplicate_field("packetDrift")); } - packet_drift__ = map.next_value()?; + packet_drift__ = map_.next_value()?; } GeneratedField::ReportDrift => { if report_drift__.is_some() { return Err(serde::de::Error::duplicate_field("reportDrift")); } - report_drift__ = map.next_value()?; + report_drift__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -12100,10 +12090,9 @@ impl<'de> serde::Deserialize<'de> for ReconnectReason { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ReconnectReason::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -12113,10 +12102,9 @@ impl<'de> serde::Deserialize<'de> for ReconnectReason { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(ReconnectReason::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -12219,28 +12207,28 @@ impl<'de> serde::Deserialize<'de> for ReconnectResponse { formatter.write_str("struct livekit.ReconnectResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut ice_servers__ = None; let mut client_configuration__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::IceServers => { if ice_servers__.is_some() { return Err(serde::de::Error::duplicate_field("iceServers")); } - ice_servers__ = Some(map.next_value()?); + ice_servers__ = Some(map_.next_value()?); } GeneratedField::ClientConfiguration => { if client_configuration__.is_some() { return Err(serde::de::Error::duplicate_field("clientConfiguration")); } - client_configuration__ = map.next_value()?; + client_configuration__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -12278,6 +12266,7 @@ impl serde::Serialize for RegionInfo { struct_ser.serialize_field("url", &self.url)?; } if self.distance != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("distance", ToString::to_string(&self.distance).as_str())?; } struct_ser.end() @@ -12340,37 +12329,37 @@ impl<'de> serde::Deserialize<'de> for RegionInfo { formatter.write_str("struct livekit.RegionInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut region__ = None; let mut url__ = None; let mut distance__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Region => { if region__.is_some() { return Err(serde::de::Error::duplicate_field("region")); } - region__ = Some(map.next_value()?); + region__ = Some(map_.next_value()?); } GeneratedField::Url => { if url__.is_some() { return Err(serde::de::Error::duplicate_field("url")); } - url__ = Some(map.next_value()?); + url__ = Some(map_.next_value()?); } GeneratedField::Distance => { if distance__.is_some() { return Err(serde::de::Error::duplicate_field("distance")); } distance__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -12453,21 +12442,21 @@ impl<'de> serde::Deserialize<'de> for RegionSettings { formatter.write_str("struct livekit.RegionSettings") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut regions__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Regions => { if regions__.is_some() { return Err(serde::de::Error::duplicate_field("regions")); } - regions__ = Some(map.next_value()?); + regions__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -12537,12 +12526,12 @@ impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { formatter.write_str("struct livekit.RemoveParticipantResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - while map.next_key::()?.is_some() { - let _ = map.next_value::()?; + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } Ok(RemoveParticipantResponse { }) @@ -12609,6 +12598,7 @@ impl serde::Serialize for Room { struct_ser.serialize_field("maxParticipants", &self.max_participants)?; } if self.creation_time != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("creationTime", ToString::to_string(&self.creation_time).as_str())?; } if !self.turn_password.is_empty() { @@ -12727,7 +12717,7 @@ impl<'de> serde::Deserialize<'de> for Room { formatter.write_str("struct livekit.Room") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -12743,26 +12733,26 @@ impl<'de> serde::Deserialize<'de> for Room { let mut num_publishers__ = None; let mut active_recording__ = None; let mut version__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Sid => { if sid__.is_some() { return Err(serde::de::Error::duplicate_field("sid")); } - sid__ = Some(map.next_value()?); + sid__ = Some(map_.next_value()?); } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::EmptyTimeout => { if empty_timeout__.is_some() { return Err(serde::de::Error::duplicate_field("emptyTimeout")); } empty_timeout__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::MaxParticipants => { @@ -12770,7 +12760,7 @@ impl<'de> serde::Deserialize<'de> for Room { return Err(serde::de::Error::duplicate_field("maxParticipants")); } max_participants__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::CreationTime => { @@ -12778,33 +12768,33 @@ impl<'de> serde::Deserialize<'de> for Room { return Err(serde::de::Error::duplicate_field("creationTime")); } creation_time__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::TurnPassword => { if turn_password__.is_some() { return Err(serde::de::Error::duplicate_field("turnPassword")); } - turn_password__ = Some(map.next_value()?); + turn_password__ = Some(map_.next_value()?); } GeneratedField::EnabledCodecs => { if enabled_codecs__.is_some() { return Err(serde::de::Error::duplicate_field("enabledCodecs")); } - enabled_codecs__ = Some(map.next_value()?); + enabled_codecs__ = Some(map_.next_value()?); } GeneratedField::Metadata => { if metadata__.is_some() { return Err(serde::de::Error::duplicate_field("metadata")); } - metadata__ = Some(map.next_value()?); + metadata__ = Some(map_.next_value()?); } GeneratedField::NumParticipants => { if num_participants__.is_some() { return Err(serde::de::Error::duplicate_field("numParticipants")); } num_participants__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::NumPublishers => { @@ -12812,23 +12802,23 @@ impl<'de> serde::Deserialize<'de> for Room { return Err(serde::de::Error::duplicate_field("numPublishers")); } num_publishers__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::ActiveRecording => { if active_recording__.is_some() { return Err(serde::de::Error::duplicate_field("activeRecording")); } - active_recording__ = Some(map.next_value()?); + active_recording__ = Some(map_.next_value()?); } GeneratedField::Version => { if version__.is_some() { return Err(serde::de::Error::duplicate_field("version")); } - version__ = map.next_value()?; + version__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -12936,8 +12926,8 @@ impl serde::Serialize for RoomCompositeEgressRequest { if let Some(v) = self.options.as_ref() { match v { room_composite_egress_request::Options::Preset(v) => { - let v = EncodingOptionsPreset::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + let v = EncodingOptionsPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("preset", &v)?; } room_composite_egress_request::Options::Advanced(v) => { @@ -13046,7 +13036,7 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { formatter.write_str("struct livekit.RoomCompositeEgressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -13061,98 +13051,98 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { let mut image_outputs__ = None; let mut output__ = None; let mut options__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::Layout => { if layout__.is_some() { return Err(serde::de::Error::duplicate_field("layout")); } - layout__ = Some(map.next_value()?); + layout__ = Some(map_.next_value()?); } GeneratedField::AudioOnly => { if audio_only__.is_some() { return Err(serde::de::Error::duplicate_field("audioOnly")); } - audio_only__ = Some(map.next_value()?); + audio_only__ = Some(map_.next_value()?); } GeneratedField::VideoOnly => { if video_only__.is_some() { return Err(serde::de::Error::duplicate_field("videoOnly")); } - video_only__ = Some(map.next_value()?); + video_only__ = Some(map_.next_value()?); } GeneratedField::CustomBaseUrl => { if custom_base_url__.is_some() { return Err(serde::de::Error::duplicate_field("customBaseUrl")); } - custom_base_url__ = Some(map.next_value()?); + custom_base_url__ = Some(map_.next_value()?); } GeneratedField::FileOutputs => { if file_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("fileOutputs")); } - file_outputs__ = Some(map.next_value()?); + file_outputs__ = Some(map_.next_value()?); } GeneratedField::StreamOutputs => { if stream_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("streamOutputs")); } - stream_outputs__ = Some(map.next_value()?); + stream_outputs__ = Some(map_.next_value()?); } GeneratedField::SegmentOutputs => { if segment_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("segmentOutputs")); } - segment_outputs__ = Some(map.next_value()?); + segment_outputs__ = Some(map_.next_value()?); } GeneratedField::ImageOutputs => { if image_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("imageOutputs")); } - image_outputs__ = Some(map.next_value()?); + image_outputs__ = Some(map_.next_value()?); } GeneratedField::File => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("file")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::File) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::File) ; } GeneratedField::Stream => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("stream")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::Stream) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::Stream) ; } GeneratedField::Segments => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("segments")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::Segments) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::Segments) ; } GeneratedField::Preset => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("preset")); } - options__ = map.next_value::<::std::option::Option>()?.map(|x| room_composite_egress_request::Options::Preset(x as i32)); + options__ = map_.next_value::<::std::option::Option>()?.map(|x| room_composite_egress_request::Options::Preset(x as i32)); } GeneratedField::Advanced => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("advanced")); } - options__ = map.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Options::Advanced) + options__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Options::Advanced) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -13261,35 +13251,35 @@ impl<'de> serde::Deserialize<'de> for RoomEgress { formatter.write_str("struct livekit.RoomEgress") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room__ = None; let mut participant__ = None; let mut tracks__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = map.next_value()?; + room__ = map_.next_value()?; } GeneratedField::Participant => { if participant__.is_some() { return Err(serde::de::Error::duplicate_field("participant")); } - participant__ = map.next_value()?; + participant__ = map_.next_value()?; } GeneratedField::Tracks => { if tracks__.is_some() { return Err(serde::de::Error::duplicate_field("tracks")); } - tracks__ = map.next_value()?; + tracks__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -13381,28 +13371,28 @@ impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { formatter.write_str("struct livekit.RoomParticipantIdentity") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room__ = None; let mut identity__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::Identity => { if identity__.is_some() { return Err(serde::de::Error::duplicate_field("identity")); } - identity__ = Some(map.next_value()?); + identity__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -13484,21 +13474,21 @@ impl<'de> serde::Deserialize<'de> for RoomUpdate { formatter.write_str("struct livekit.RoomUpdate") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = map.next_value()?; + room__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -13654,7 +13644,7 @@ impl<'de> serde::Deserialize<'de> for S3Upload { formatter.write_str("struct livekit.S3Upload") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -13667,66 +13657,66 @@ impl<'de> serde::Deserialize<'de> for S3Upload { let mut metadata__ = None; let mut tagging__ = None; let mut content_disposition__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::AccessKey => { if access_key__.is_some() { return Err(serde::de::Error::duplicate_field("accessKey")); } - access_key__ = Some(map.next_value()?); + access_key__ = Some(map_.next_value()?); } GeneratedField::Secret => { if secret__.is_some() { return Err(serde::de::Error::duplicate_field("secret")); } - secret__ = Some(map.next_value()?); + secret__ = Some(map_.next_value()?); } GeneratedField::Region => { if region__.is_some() { return Err(serde::de::Error::duplicate_field("region")); } - region__ = Some(map.next_value()?); + region__ = Some(map_.next_value()?); } GeneratedField::Endpoint => { if endpoint__.is_some() { return Err(serde::de::Error::duplicate_field("endpoint")); } - endpoint__ = Some(map.next_value()?); + endpoint__ = Some(map_.next_value()?); } GeneratedField::Bucket => { if bucket__.is_some() { return Err(serde::de::Error::duplicate_field("bucket")); } - bucket__ = Some(map.next_value()?); + bucket__ = Some(map_.next_value()?); } GeneratedField::ForcePathStyle => { if force_path_style__.is_some() { return Err(serde::de::Error::duplicate_field("forcePathStyle")); } - force_path_style__ = Some(map.next_value()?); + force_path_style__ = Some(map_.next_value()?); } GeneratedField::Metadata => { if metadata__.is_some() { return Err(serde::de::Error::duplicate_field("metadata")); } metadata__ = Some( - map.next_value::>()? + map_.next_value::>()? ); } GeneratedField::Tagging => { if tagging__.is_some() { return Err(serde::de::Error::duplicate_field("tagging")); } - tagging__ = Some(map.next_value()?); + tagging__ = Some(map_.next_value()?); } GeneratedField::ContentDisposition => { if content_disposition__.is_some() { return Err(serde::de::Error::duplicate_field("contentDisposition")); } - content_disposition__ = Some(map.next_value()?); + content_disposition__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -13780,8 +13770,8 @@ impl serde::Serialize for SegmentedFileOutput { } let mut struct_ser = serializer.serialize_struct("livekit.SegmentedFileOutput", len)?; if self.protocol != 0 { - let v = SegmentedFileProtocol::from_i32(self.protocol) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.protocol)))?; + let v = SegmentedFileProtocol::try_from(self.protocol) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.protocol)))?; struct_ser.serialize_field("protocol", &v)?; } if !self.filename_prefix.is_empty() { @@ -13797,8 +13787,8 @@ impl serde::Serialize for SegmentedFileOutput { struct_ser.serialize_field("segmentDuration", &self.segment_duration)?; } if self.filename_suffix != 0 { - let v = SegmentedFileSuffix::from_i32(self.filename_suffix) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.filename_suffix)))?; + let v = SegmentedFileSuffix::try_from(self.filename_suffix) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.filename_suffix)))?; struct_ser.serialize_field("filenameSuffix", &v)?; } if self.disable_manifest { @@ -13910,7 +13900,7 @@ impl<'de> serde::Deserialize<'de> for SegmentedFileOutput { formatter.write_str("struct livekit.SegmentedFileOutput") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -13922,82 +13912,82 @@ impl<'de> serde::Deserialize<'de> for SegmentedFileOutput { let mut filename_suffix__ = None; let mut disable_manifest__ = None; let mut output__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Protocol => { if protocol__.is_some() { return Err(serde::de::Error::duplicate_field("protocol")); } - protocol__ = Some(map.next_value::()? as i32); + protocol__ = Some(map_.next_value::()? as i32); } GeneratedField::FilenamePrefix => { if filename_prefix__.is_some() { return Err(serde::de::Error::duplicate_field("filenamePrefix")); } - filename_prefix__ = Some(map.next_value()?); + filename_prefix__ = Some(map_.next_value()?); } GeneratedField::PlaylistName => { if playlist_name__.is_some() { return Err(serde::de::Error::duplicate_field("playlistName")); } - playlist_name__ = Some(map.next_value()?); + playlist_name__ = Some(map_.next_value()?); } GeneratedField::LivePlaylistName => { if live_playlist_name__.is_some() { return Err(serde::de::Error::duplicate_field("livePlaylistName")); } - live_playlist_name__ = Some(map.next_value()?); + live_playlist_name__ = Some(map_.next_value()?); } GeneratedField::SegmentDuration => { if segment_duration__.is_some() { return Err(serde::de::Error::duplicate_field("segmentDuration")); } segment_duration__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::FilenameSuffix => { if filename_suffix__.is_some() { return Err(serde::de::Error::duplicate_field("filenameSuffix")); } - filename_suffix__ = Some(map.next_value::()? as i32); + filename_suffix__ = Some(map_.next_value::()? as i32); } GeneratedField::DisableManifest => { if disable_manifest__.is_some() { return Err(serde::de::Error::duplicate_field("disableManifest")); } - disable_manifest__ = Some(map.next_value()?); + disable_manifest__ = Some(map_.next_value()?); } GeneratedField::S3 => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("s3")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::S3) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::S3) ; } GeneratedField::Gcp => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("gcp")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::Gcp) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::Gcp) ; } GeneratedField::Azure => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("azure")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::Azure) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::Azure) ; } GeneratedField::AliOss => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("aliOSS")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::AliOss) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::AliOss) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -14053,10 +14043,9 @@ impl<'de> serde::Deserialize<'de> for SegmentedFileProtocol { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(SegmentedFileProtocol::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -14066,10 +14055,9 @@ impl<'de> serde::Deserialize<'de> for SegmentedFileProtocol { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(SegmentedFileProtocol::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -14126,10 +14114,9 @@ impl<'de> serde::Deserialize<'de> for SegmentedFileSuffix { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(SegmentedFileSuffix::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -14139,10 +14126,9 @@ impl<'de> serde::Deserialize<'de> for SegmentedFileSuffix { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(SegmentedFileSuffix::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -14205,9 +14191,11 @@ impl serde::Serialize for SegmentsInfo { struct_ser.serialize_field("livePlaylistName", &self.live_playlist_name)?; } if self.duration != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; } if self.size != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("size", ToString::to_string(&self.size).as_str())?; } if !self.playlist_location.is_empty() { @@ -14217,12 +14205,15 @@ impl serde::Serialize for SegmentsInfo { struct_ser.serialize_field("livePlaylistLocation", &self.live_playlist_location)?; } if self.segment_count != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("segmentCount", ToString::to_string(&self.segment_count).as_str())?; } if self.started_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } struct_ser.end() @@ -14310,7 +14301,7 @@ impl<'de> serde::Deserialize<'de> for SegmentsInfo { formatter.write_str("struct livekit.SegmentsInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -14323,26 +14314,26 @@ impl<'de> serde::Deserialize<'de> for SegmentsInfo { let mut segment_count__ = None; let mut started_at__ = None; let mut ended_at__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::PlaylistName => { if playlist_name__.is_some() { return Err(serde::de::Error::duplicate_field("playlistName")); } - playlist_name__ = Some(map.next_value()?); + playlist_name__ = Some(map_.next_value()?); } GeneratedField::LivePlaylistName => { if live_playlist_name__.is_some() { return Err(serde::de::Error::duplicate_field("livePlaylistName")); } - live_playlist_name__ = Some(map.next_value()?); + live_playlist_name__ = Some(map_.next_value()?); } GeneratedField::Duration => { if duration__.is_some() { return Err(serde::de::Error::duplicate_field("duration")); } duration__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Size => { @@ -14350,27 +14341,27 @@ impl<'de> serde::Deserialize<'de> for SegmentsInfo { return Err(serde::de::Error::duplicate_field("size")); } size__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::PlaylistLocation => { if playlist_location__.is_some() { return Err(serde::de::Error::duplicate_field("playlistLocation")); } - playlist_location__ = Some(map.next_value()?); + playlist_location__ = Some(map_.next_value()?); } GeneratedField::LivePlaylistLocation => { if live_playlist_location__.is_some() { return Err(serde::de::Error::duplicate_field("livePlaylistLocation")); } - live_playlist_location__ = Some(map.next_value()?); + live_playlist_location__ = Some(map_.next_value()?); } GeneratedField::SegmentCount => { if segment_count__.is_some() { return Err(serde::de::Error::duplicate_field("segmentCount")); } segment_count__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::StartedAt => { @@ -14378,7 +14369,7 @@ impl<'de> serde::Deserialize<'de> for SegmentsInfo { return Err(serde::de::Error::duplicate_field("startedAt")); } started_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::EndedAt => { @@ -14386,11 +14377,11 @@ impl<'de> serde::Deserialize<'de> for SegmentsInfo { return Err(serde::de::Error::duplicate_field("endedAt")); } ended_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -14441,11 +14432,12 @@ impl serde::Serialize for SendDataRequest { struct_ser.serialize_field("room", &self.room)?; } if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; } if self.kind != 0 { - let v = data_packet::Kind::from_i32(self.kind) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; + let v = data_packet::Kind::try_from(self.kind) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; struct_ser.serialize_field("kind", &v)?; } if !self.destination_sids.is_empty() { @@ -14528,7 +14520,7 @@ impl<'de> serde::Deserialize<'de> for SendDataRequest { formatter.write_str("struct livekit.SendDataRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -14538,48 +14530,48 @@ impl<'de> serde::Deserialize<'de> for SendDataRequest { let mut destination_sids__ = None; let mut destination_identities__ = None; let mut topic__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::Data => { if data__.is_some() { return Err(serde::de::Error::duplicate_field("data")); } data__ = - Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) ; } GeneratedField::Kind => { if kind__.is_some() { return Err(serde::de::Error::duplicate_field("kind")); } - kind__ = Some(map.next_value::()? as i32); + kind__ = Some(map_.next_value::()? as i32); } GeneratedField::DestinationSids => { if destination_sids__.is_some() { return Err(serde::de::Error::duplicate_field("destinationSids")); } - destination_sids__ = Some(map.next_value()?); + destination_sids__ = Some(map_.next_value()?); } GeneratedField::DestinationIdentities => { if destination_identities__.is_some() { return Err(serde::de::Error::duplicate_field("destinationIdentities")); } - destination_identities__ = Some(map.next_value()?); + destination_identities__ = Some(map_.next_value()?); } GeneratedField::Topic => { if topic__.is_some() { return Err(serde::de::Error::duplicate_field("topic")); } - topic__ = map.next_value()?; + topic__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -14654,12 +14646,12 @@ impl<'de> serde::Deserialize<'de> for SendDataResponse { formatter.write_str("struct livekit.SendDataResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - while map.next_key::()?.is_some() { - let _ = map.next_value::()?; + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } Ok(SendDataResponse { }) @@ -14696,8 +14688,8 @@ impl serde::Serialize for ServerInfo { } let mut struct_ser = serializer.serialize_struct("livekit.ServerInfo", len)?; if self.edition != 0 { - let v = server_info::Edition::from_i32(self.edition) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.edition)))?; + let v = server_info::Edition::try_from(self.edition) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.edition)))?; struct_ser.serialize_field("edition", &v)?; } if !self.version.is_empty() { @@ -14786,7 +14778,7 @@ impl<'de> serde::Deserialize<'de> for ServerInfo { formatter.write_str("struct livekit.ServerInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -14796,48 +14788,48 @@ impl<'de> serde::Deserialize<'de> for ServerInfo { let mut region__ = None; let mut node_id__ = None; let mut debug_info__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Edition => { if edition__.is_some() { return Err(serde::de::Error::duplicate_field("edition")); } - edition__ = Some(map.next_value::()? as i32); + edition__ = Some(map_.next_value::()? as i32); } GeneratedField::Version => { if version__.is_some() { return Err(serde::de::Error::duplicate_field("version")); } - version__ = Some(map.next_value()?); + version__ = Some(map_.next_value()?); } GeneratedField::Protocol => { if protocol__.is_some() { return Err(serde::de::Error::duplicate_field("protocol")); } protocol__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Region => { if region__.is_some() { return Err(serde::de::Error::duplicate_field("region")); } - region__ = Some(map.next_value()?); + region__ = Some(map_.next_value()?); } GeneratedField::NodeId => { if node_id__.is_some() { return Err(serde::de::Error::duplicate_field("nodeId")); } - node_id__ = Some(map.next_value()?); + node_id__ = Some(map_.next_value()?); } GeneratedField::DebugInfo => { if debug_info__.is_some() { return Err(serde::de::Error::duplicate_field("debugInfo")); } - debug_info__ = Some(map.next_value()?); + debug_info__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -14891,10 +14883,9 @@ impl<'de> serde::Deserialize<'de> for server_info::Edition { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(server_info::Edition::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -14904,10 +14895,9 @@ impl<'de> serde::Deserialize<'de> for server_info::Edition { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(server_info::Edition::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -15005,28 +14995,28 @@ impl<'de> serde::Deserialize<'de> for SessionDescription { formatter.write_str("struct livekit.SessionDescription") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut r#type__ = None; let mut sdp__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Type => { if r#type__.is_some() { return Err(serde::de::Error::duplicate_field("type")); } - r#type__ = Some(map.next_value()?); + r#type__ = Some(map_.next_value()?); } GeneratedField::Sdp => { if sdp__.is_some() { return Err(serde::de::Error::duplicate_field("sdp")); } - sdp__ = Some(map.next_value()?); + sdp__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -15090,6 +15080,7 @@ impl serde::Serialize for SignalRequest { struct_ser.serialize_field("simulate", v)?; } signal_request::Message::Ping(v) => { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("ping", ToString::to_string(&v).as_str())?; } signal_request::Message::UpdateMetadata(v) => { @@ -15203,119 +15194,119 @@ impl<'de> serde::Deserialize<'de> for SignalRequest { formatter.write_str("struct livekit.SignalRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut message__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Offer => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("offer")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Offer) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Offer) ; } GeneratedField::Answer => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("answer")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Answer) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Answer) ; } GeneratedField::Trickle => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("trickle")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Trickle) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Trickle) ; } GeneratedField::AddTrack => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("addTrack")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::AddTrack) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::AddTrack) ; } GeneratedField::Mute => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("mute")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Mute) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Mute) ; } GeneratedField::Subscription => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("subscription")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Subscription) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Subscription) ; } GeneratedField::TrackSetting => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("trackSetting")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::TrackSetting) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::TrackSetting) ; } GeneratedField::Leave => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("leave")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Leave) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Leave) ; } GeneratedField::UpdateLayers => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("updateLayers")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateLayers) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateLayers) ; } GeneratedField::SubscriptionPermission => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("subscriptionPermission")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::SubscriptionPermission) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::SubscriptionPermission) ; } GeneratedField::SyncState => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("syncState")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::SyncState) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::SyncState) ; } GeneratedField::Simulate => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("simulate")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Simulate) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Simulate) ; } GeneratedField::Ping => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("ping")); } - message__ = map.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| signal_request::Message::Ping(x.0)); + message__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| signal_request::Message::Ping(x.0)); } GeneratedField::UpdateMetadata => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("updateMetadata")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateMetadata) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateMetadata) ; } GeneratedField::PingReq => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("pingReq")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::PingReq) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::PingReq) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -15390,6 +15381,7 @@ impl serde::Serialize for SignalResponse { struct_ser.serialize_field("trackUnpublished", v)?; } signal_response::Message::Pong(v) => { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("pong", ToString::to_string(&v).as_str())?; } signal_response::Message::Reconnect(v) => { @@ -15525,153 +15517,153 @@ impl<'de> serde::Deserialize<'de> for SignalResponse { formatter.write_str("struct livekit.SignalResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut message__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Join => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("join")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Join) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Join) ; } GeneratedField::Answer => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("answer")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Answer) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Answer) ; } GeneratedField::Offer => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("offer")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Offer) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Offer) ; } GeneratedField::Trickle => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("trickle")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Trickle) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Trickle) ; } GeneratedField::Update => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("update")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Update) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Update) ; } GeneratedField::TrackPublished => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("trackPublished")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackPublished) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackPublished) ; } GeneratedField::Leave => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("leave")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Leave) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Leave) ; } GeneratedField::Mute => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("mute")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Mute) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Mute) ; } GeneratedField::SpeakersChanged => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("speakersChanged")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SpeakersChanged) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SpeakersChanged) ; } GeneratedField::RoomUpdate => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("roomUpdate")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::RoomUpdate) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::RoomUpdate) ; } GeneratedField::ConnectionQuality => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("connectionQuality")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::ConnectionQuality) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::ConnectionQuality) ; } GeneratedField::StreamStateUpdate => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("streamStateUpdate")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::StreamStateUpdate) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::StreamStateUpdate) ; } GeneratedField::SubscribedQualityUpdate => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("subscribedQualityUpdate")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscribedQualityUpdate) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscribedQualityUpdate) ; } GeneratedField::SubscriptionPermissionUpdate => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("subscriptionPermissionUpdate")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscriptionPermissionUpdate) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscriptionPermissionUpdate) ; } GeneratedField::RefreshToken => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("refreshToken")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::RefreshToken); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::RefreshToken); } GeneratedField::TrackUnpublished => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("trackUnpublished")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackUnpublished) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackUnpublished) ; } GeneratedField::Pong => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("pong")); } - message__ = map.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| signal_response::Message::Pong(x.0)); + message__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| signal_response::Message::Pong(x.0)); } GeneratedField::Reconnect => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("reconnect")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Reconnect) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Reconnect) ; } GeneratedField::PongResp => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("pongResp")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::PongResp) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::PongResp) ; } GeneratedField::SubscriptionResponse => { if message__.is_some() { return Err(serde::de::Error::duplicate_field("subscriptionResponse")); } - message__ = map.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscriptionResponse) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscriptionResponse) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -15720,10 +15712,9 @@ impl<'de> serde::Deserialize<'de> for SignalTarget { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(SignalTarget::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -15733,10 +15724,9 @@ impl<'de> serde::Deserialize<'de> for SignalTarget { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(SignalTarget::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -15783,11 +15773,12 @@ impl serde::Serialize for SimulateScenario { struct_ser.serialize_field("serverLeave", v)?; } simulate_scenario::Scenario::SwitchCandidateProtocol(v) => { - let v = CandidateProtocol::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + let v = CandidateProtocol::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("switchCandidateProtocol", &v)?; } simulate_scenario::Scenario::SubscriberBandwidth(v) => { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("subscriberBandwidth", ToString::to_string(&v).as_str())?; } } @@ -15866,51 +15857,51 @@ impl<'de> serde::Deserialize<'de> for SimulateScenario { formatter.write_str("struct livekit.SimulateScenario") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut scenario__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::SpeakerUpdate => { if scenario__.is_some() { return Err(serde::de::Error::duplicate_field("speakerUpdate")); } - scenario__ = map.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| simulate_scenario::Scenario::SpeakerUpdate(x.0)); + scenario__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| simulate_scenario::Scenario::SpeakerUpdate(x.0)); } GeneratedField::NodeFailure => { if scenario__.is_some() { return Err(serde::de::Error::duplicate_field("nodeFailure")); } - scenario__ = map.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::NodeFailure); + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::NodeFailure); } GeneratedField::Migration => { if scenario__.is_some() { return Err(serde::de::Error::duplicate_field("migration")); } - scenario__ = map.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::Migration); + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::Migration); } GeneratedField::ServerLeave => { if scenario__.is_some() { return Err(serde::de::Error::duplicate_field("serverLeave")); } - scenario__ = map.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::ServerLeave); + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::ServerLeave); } GeneratedField::SwitchCandidateProtocol => { if scenario__.is_some() { return Err(serde::de::Error::duplicate_field("switchCandidateProtocol")); } - scenario__ = map.next_value::<::std::option::Option>()?.map(|x| simulate_scenario::Scenario::SwitchCandidateProtocol(x as i32)); + scenario__ = map_.next_value::<::std::option::Option>()?.map(|x| simulate_scenario::Scenario::SwitchCandidateProtocol(x as i32)); } GeneratedField::SubscriberBandwidth => { if scenario__.is_some() { return Err(serde::de::Error::duplicate_field("subscriberBandwidth")); } - scenario__ = map.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| simulate_scenario::Scenario::SubscriberBandwidth(x.0)); + scenario__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| simulate_scenario::Scenario::SubscriberBandwidth(x.0)); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -16000,28 +15991,28 @@ impl<'de> serde::Deserialize<'de> for SimulcastCodec { formatter.write_str("struct livekit.SimulcastCodec") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut codec__ = None; let mut cid__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Codec => { if codec__.is_some() { return Err(serde::de::Error::duplicate_field("codec")); } - codec__ = Some(map.next_value()?); + codec__ = Some(map_.next_value()?); } GeneratedField::Cid => { if cid__.is_some() { return Err(serde::de::Error::duplicate_field("cid")); } - cid__ = Some(map.next_value()?); + cid__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -16131,7 +16122,7 @@ impl<'de> serde::Deserialize<'de> for SimulcastCodecInfo { formatter.write_str("struct livekit.SimulcastCodecInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -16139,34 +16130,34 @@ impl<'de> serde::Deserialize<'de> for SimulcastCodecInfo { let mut mid__ = None; let mut cid__ = None; let mut layers__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::MimeType => { if mime_type__.is_some() { return Err(serde::de::Error::duplicate_field("mimeType")); } - mime_type__ = Some(map.next_value()?); + mime_type__ = Some(map_.next_value()?); } GeneratedField::Mid => { if mid__.is_some() { return Err(serde::de::Error::duplicate_field("mid")); } - mid__ = Some(map.next_value()?); + mid__ = Some(map_.next_value()?); } GeneratedField::Cid => { if cid__.is_some() { return Err(serde::de::Error::duplicate_field("cid")); } - cid__ = Some(map.next_value()?); + cid__ = Some(map_.next_value()?); } GeneratedField::Layers => { if layers__.is_some() { return Err(serde::de::Error::duplicate_field("layers")); } - layers__ = Some(map.next_value()?); + layers__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -16268,37 +16259,37 @@ impl<'de> serde::Deserialize<'de> for SpeakerInfo { formatter.write_str("struct livekit.SpeakerInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut sid__ = None; let mut level__ = None; let mut active__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Sid => { if sid__.is_some() { return Err(serde::de::Error::duplicate_field("sid")); } - sid__ = Some(map.next_value()?); + sid__ = Some(map_.next_value()?); } GeneratedField::Level => { if level__.is_some() { return Err(serde::de::Error::duplicate_field("level")); } level__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Active => { if active__.is_some() { return Err(serde::de::Error::duplicate_field("active")); } - active__ = Some(map.next_value()?); + active__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -16381,21 +16372,21 @@ impl<'de> serde::Deserialize<'de> for SpeakersChanged { formatter.write_str("struct livekit.SpeakersChanged") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut speakers__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Speakers => { if speakers__.is_some() { return Err(serde::de::Error::duplicate_field("speakers")); } - speakers__ = Some(map.next_value()?); + speakers__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -16477,21 +16468,21 @@ impl<'de> serde::Deserialize<'de> for StopEgressRequest { formatter.write_str("struct livekit.StopEgressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut egress_id__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::EgressId => { if egress_id__.is_some() { return Err(serde::de::Error::duplicate_field("egressId")); } - egress_id__ = Some(map.next_value()?); + egress_id__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -16534,17 +16525,20 @@ impl serde::Serialize for StreamInfo { struct_ser.serialize_field("url", &self.url)?; } if self.started_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } if self.duration != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; } if self.status != 0 { - let v = stream_info::Status::from_i32(self.status) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; + let v = stream_info::Status::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; struct_ser.serialize_field("status", &v)?; } if !self.error.is_empty() { @@ -16621,7 +16615,7 @@ impl<'de> serde::Deserialize<'de> for StreamInfo { formatter.write_str("struct livekit.StreamInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -16631,20 +16625,20 @@ impl<'de> serde::Deserialize<'de> for StreamInfo { let mut duration__ = None; let mut status__ = None; let mut error__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Url => { if url__.is_some() { return Err(serde::de::Error::duplicate_field("url")); } - url__ = Some(map.next_value()?); + url__ = Some(map_.next_value()?); } GeneratedField::StartedAt => { if started_at__.is_some() { return Err(serde::de::Error::duplicate_field("startedAt")); } started_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::EndedAt => { @@ -16652,7 +16646,7 @@ impl<'de> serde::Deserialize<'de> for StreamInfo { return Err(serde::de::Error::duplicate_field("endedAt")); } ended_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Duration => { @@ -16660,23 +16654,23 @@ impl<'de> serde::Deserialize<'de> for StreamInfo { return Err(serde::de::Error::duplicate_field("duration")); } duration__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Status => { if status__.is_some() { return Err(serde::de::Error::duplicate_field("status")); } - status__ = Some(map.next_value::()? as i32); + status__ = Some(map_.next_value::()? as i32); } GeneratedField::Error => { if error__.is_some() { return Err(serde::de::Error::duplicate_field("error")); } - error__ = Some(map.next_value()?); + error__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -16732,10 +16726,9 @@ impl<'de> serde::Deserialize<'de> for stream_info::Status { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(stream_info::Status::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -16745,10 +16738,9 @@ impl<'de> serde::Deserialize<'de> for stream_info::Status { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(stream_info::Status::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -16838,21 +16830,21 @@ impl<'de> serde::Deserialize<'de> for StreamInfoList { formatter.write_str("struct livekit.StreamInfoList") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut info__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Info => { if info__.is_some() { return Err(serde::de::Error::duplicate_field("info")); } - info__ = Some(map.next_value()?); + info__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -16880,8 +16872,8 @@ impl serde::Serialize for StreamOutput { } let mut struct_ser = serializer.serialize_struct("livekit.StreamOutput", len)?; if self.protocol != 0 { - let v = StreamProtocol::from_i32(self.protocol) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.protocol)))?; + let v = StreamProtocol::try_from(self.protocol) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.protocol)))?; struct_ser.serialize_field("protocol", &v)?; } if !self.urls.is_empty() { @@ -16944,28 +16936,28 @@ impl<'de> serde::Deserialize<'de> for StreamOutput { formatter.write_str("struct livekit.StreamOutput") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut protocol__ = None; let mut urls__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Protocol => { if protocol__.is_some() { return Err(serde::de::Error::duplicate_field("protocol")); } - protocol__ = Some(map.next_value::()? as i32); + protocol__ = Some(map_.next_value::()? as i32); } GeneratedField::Urls => { if urls__.is_some() { return Err(serde::de::Error::duplicate_field("urls")); } - urls__ = Some(map.next_value()?); + urls__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -17015,10 +17007,9 @@ impl<'de> serde::Deserialize<'de> for StreamProtocol { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(StreamProtocol::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -17028,10 +17019,9 @@ impl<'de> serde::Deserialize<'de> for StreamProtocol { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(StreamProtocol::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -17088,10 +17078,9 @@ impl<'de> serde::Deserialize<'de> for StreamState { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(StreamState::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -17101,10 +17090,9 @@ impl<'de> serde::Deserialize<'de> for StreamState { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(StreamState::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -17149,8 +17137,8 @@ impl serde::Serialize for StreamStateInfo { struct_ser.serialize_field("trackSid", &self.track_sid)?; } if self.state != 0 { - let v = StreamState::from_i32(self.state) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; + let v = StreamState::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; struct_ser.serialize_field("state", &v)?; } struct_ser.end() @@ -17215,35 +17203,35 @@ impl<'de> serde::Deserialize<'de> for StreamStateInfo { formatter.write_str("struct livekit.StreamStateInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut participant_sid__ = None; let mut track_sid__ = None; let mut state__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::ParticipantSid => { if participant_sid__.is_some() { return Err(serde::de::Error::duplicate_field("participantSid")); } - participant_sid__ = Some(map.next_value()?); + participant_sid__ = Some(map_.next_value()?); } GeneratedField::TrackSid => { if track_sid__.is_some() { return Err(serde::de::Error::duplicate_field("trackSid")); } - track_sid__ = Some(map.next_value()?); + track_sid__ = Some(map_.next_value()?); } GeneratedField::State => { if state__.is_some() { return Err(serde::de::Error::duplicate_field("state")); } - state__ = Some(map.next_value::()? as i32); + state__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -17327,21 +17315,21 @@ impl<'de> serde::Deserialize<'de> for StreamStateUpdate { formatter.write_str("struct livekit.StreamStateUpdate") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut stream_states__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::StreamStates => { if stream_states__.is_some() { return Err(serde::de::Error::duplicate_field("streamStates")); } - stream_states__ = Some(map.next_value()?); + stream_states__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -17431,28 +17419,28 @@ impl<'de> serde::Deserialize<'de> for SubscribedCodec { formatter.write_str("struct livekit.SubscribedCodec") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut codec__ = None; let mut qualities__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Codec => { if codec__.is_some() { return Err(serde::de::Error::duplicate_field("codec")); } - codec__ = Some(map.next_value()?); + codec__ = Some(map_.next_value()?); } GeneratedField::Qualities => { if qualities__.is_some() { return Err(serde::de::Error::duplicate_field("qualities")); } - qualities__ = Some(map.next_value()?); + qualities__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -17481,8 +17469,8 @@ impl serde::Serialize for SubscribedQuality { } let mut struct_ser = serializer.serialize_struct("livekit.SubscribedQuality", len)?; if self.quality != 0 { - let v = VideoQuality::from_i32(self.quality) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; + let v = VideoQuality::try_from(self.quality) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; struct_ser.serialize_field("quality", &v)?; } if self.enabled { @@ -17545,28 +17533,28 @@ impl<'de> serde::Deserialize<'de> for SubscribedQuality { formatter.write_str("struct livekit.SubscribedQuality") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut quality__ = None; let mut enabled__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Quality => { if quality__.is_some() { return Err(serde::de::Error::duplicate_field("quality")); } - quality__ = Some(map.next_value::()? as i32); + quality__ = Some(map_.next_value::()? as i32); } GeneratedField::Enabled => { if enabled__.is_some() { return Err(serde::de::Error::duplicate_field("enabled")); } - enabled__ = Some(map.next_value()?); + enabled__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -17669,35 +17657,35 @@ impl<'de> serde::Deserialize<'de> for SubscribedQualityUpdate { formatter.write_str("struct livekit.SubscribedQualityUpdate") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut track_sid__ = None; let mut subscribed_qualities__ = None; let mut subscribed_codecs__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::TrackSid => { if track_sid__.is_some() { return Err(serde::de::Error::duplicate_field("trackSid")); } - track_sid__ = Some(map.next_value()?); + track_sid__ = Some(map_.next_value()?); } GeneratedField::SubscribedQualities => { if subscribed_qualities__.is_some() { return Err(serde::de::Error::duplicate_field("subscribedQualities")); } - subscribed_qualities__ = Some(map.next_value()?); + subscribed_qualities__ = Some(map_.next_value()?); } GeneratedField::SubscribedCodecs => { if subscribed_codecs__.is_some() { return Err(serde::de::Error::duplicate_field("subscribedCodecs")); } - subscribed_codecs__ = Some(map.next_value()?); + subscribed_codecs__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -17750,10 +17738,9 @@ impl<'de> serde::Deserialize<'de> for SubscriptionError { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(SubscriptionError::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -17763,10 +17750,9 @@ impl<'de> serde::Deserialize<'de> for SubscriptionError { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(SubscriptionError::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -17867,28 +17853,28 @@ impl<'de> serde::Deserialize<'de> for SubscriptionPermission { formatter.write_str("struct livekit.SubscriptionPermission") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut all_participants__ = None; let mut track_permissions__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::AllParticipants => { if all_participants__.is_some() { return Err(serde::de::Error::duplicate_field("allParticipants")); } - all_participants__ = Some(map.next_value()?); + all_participants__ = Some(map_.next_value()?); } GeneratedField::TrackPermissions => { if track_permissions__.is_some() { return Err(serde::de::Error::duplicate_field("trackPermissions")); } - track_permissions__ = Some(map.next_value()?); + track_permissions__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -17990,35 +17976,35 @@ impl<'de> serde::Deserialize<'de> for SubscriptionPermissionUpdate { formatter.write_str("struct livekit.SubscriptionPermissionUpdate") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut participant_sid__ = None; let mut track_sid__ = None; let mut allowed__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::ParticipantSid => { if participant_sid__.is_some() { return Err(serde::de::Error::duplicate_field("participantSid")); } - participant_sid__ = Some(map.next_value()?); + participant_sid__ = Some(map_.next_value()?); } GeneratedField::TrackSid => { if track_sid__.is_some() { return Err(serde::de::Error::duplicate_field("trackSid")); } - track_sid__ = Some(map.next_value()?); + track_sid__ = Some(map_.next_value()?); } GeneratedField::Allowed => { if allowed__.is_some() { return Err(serde::de::Error::duplicate_field("allowed")); } - allowed__ = Some(map.next_value()?); + allowed__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -18051,8 +18037,8 @@ impl serde::Serialize for SubscriptionResponse { struct_ser.serialize_field("trackSid", &self.track_sid)?; } if self.err != 0 { - let v = SubscriptionError::from_i32(self.err) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.err)))?; + let v = SubscriptionError::try_from(self.err) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.err)))?; struct_ser.serialize_field("err", &v)?; } struct_ser.end() @@ -18113,28 +18099,28 @@ impl<'de> serde::Deserialize<'de> for SubscriptionResponse { formatter.write_str("struct livekit.SubscriptionResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut track_sid__ = None; let mut err__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::TrackSid => { if track_sid__.is_some() { return Err(serde::de::Error::duplicate_field("trackSid")); } - track_sid__ = Some(map.next_value()?); + track_sid__ = Some(map_.next_value()?); } GeneratedField::Err => { if err__.is_some() { return Err(serde::de::Error::duplicate_field("err")); } - err__ = Some(map.next_value::()? as i32); + err__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -18254,7 +18240,7 @@ impl<'de> serde::Deserialize<'de> for SyncState { formatter.write_str("struct livekit.SyncState") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -18263,40 +18249,40 @@ impl<'de> serde::Deserialize<'de> for SyncState { let mut publish_tracks__ = None; let mut data_channels__ = None; let mut offer__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Answer => { if answer__.is_some() { return Err(serde::de::Error::duplicate_field("answer")); } - answer__ = map.next_value()?; + answer__ = map_.next_value()?; } GeneratedField::Subscription => { if subscription__.is_some() { return Err(serde::de::Error::duplicate_field("subscription")); } - subscription__ = map.next_value()?; + subscription__ = map_.next_value()?; } GeneratedField::PublishTracks => { if publish_tracks__.is_some() { return Err(serde::de::Error::duplicate_field("publishTracks")); } - publish_tracks__ = Some(map.next_value()?); + publish_tracks__ = Some(map_.next_value()?); } GeneratedField::DataChannels => { if data_channels__.is_some() { return Err(serde::de::Error::duplicate_field("dataChannels")); } - data_channels__ = Some(map.next_value()?); + data_channels__ = Some(map_.next_value()?); } GeneratedField::Offer => { if offer__.is_some() { return Err(serde::de::Error::duplicate_field("offer")); } - offer__ = map.next_value()?; + offer__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -18328,6 +18314,7 @@ impl serde::Serialize for TimedVersion { } let mut struct_ser = serializer.serialize_struct("livekit.TimedVersion", len)?; if self.unix_micro != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("unixMicro", ToString::to_string(&self.unix_micro).as_str())?; } if self.ticks != 0 { @@ -18391,20 +18378,20 @@ impl<'de> serde::Deserialize<'de> for TimedVersion { formatter.write_str("struct livekit.TimedVersion") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut unix_micro__ = None; let mut ticks__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::UnixMicro => { if unix_micro__.is_some() { return Err(serde::de::Error::duplicate_field("unixMicro")); } unix_micro__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Ticks => { @@ -18412,11 +18399,11 @@ impl<'de> serde::Deserialize<'de> for TimedVersion { return Err(serde::de::Error::duplicate_field("ticks")); } ticks__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -18502,8 +18489,8 @@ impl serde::Serialize for TrackCompositeEgressRequest { if let Some(v) = self.options.as_ref() { match v { track_composite_egress_request::Options::Preset(v) => { - let v = EncodingOptionsPreset::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + let v = EncodingOptionsPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("preset", &v)?; } track_composite_egress_request::Options::Advanced(v) => { @@ -18605,7 +18592,7 @@ impl<'de> serde::Deserialize<'de> for TrackCompositeEgressRequest { formatter.write_str("struct livekit.TrackCompositeEgressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -18618,86 +18605,86 @@ impl<'de> serde::Deserialize<'de> for TrackCompositeEgressRequest { let mut image_outputs__ = None; let mut output__ = None; let mut options__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::AudioTrackId => { if audio_track_id__.is_some() { return Err(serde::de::Error::duplicate_field("audioTrackId")); } - audio_track_id__ = Some(map.next_value()?); + audio_track_id__ = Some(map_.next_value()?); } GeneratedField::VideoTrackId => { if video_track_id__.is_some() { return Err(serde::de::Error::duplicate_field("videoTrackId")); } - video_track_id__ = Some(map.next_value()?); + video_track_id__ = Some(map_.next_value()?); } GeneratedField::FileOutputs => { if file_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("fileOutputs")); } - file_outputs__ = Some(map.next_value()?); + file_outputs__ = Some(map_.next_value()?); } GeneratedField::StreamOutputs => { if stream_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("streamOutputs")); } - stream_outputs__ = Some(map.next_value()?); + stream_outputs__ = Some(map_.next_value()?); } GeneratedField::SegmentOutputs => { if segment_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("segmentOutputs")); } - segment_outputs__ = Some(map.next_value()?); + segment_outputs__ = Some(map_.next_value()?); } GeneratedField::ImageOutputs => { if image_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("imageOutputs")); } - image_outputs__ = Some(map.next_value()?); + image_outputs__ = Some(map_.next_value()?); } GeneratedField::File => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("file")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Output::File) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Output::File) ; } GeneratedField::Stream => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("stream")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Output::Stream) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Output::Stream) ; } GeneratedField::Segments => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("segments")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Output::Segments) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Output::Segments) ; } GeneratedField::Preset => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("preset")); } - options__ = map.next_value::<::std::option::Option>()?.map(|x| track_composite_egress_request::Options::Preset(x as i32)); + options__ = map_.next_value::<::std::option::Option>()?.map(|x| track_composite_egress_request::Options::Preset(x as i32)); } GeneratedField::Advanced => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("advanced")); } - options__ = map.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Options::Advanced) + options__ = map_.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Options::Advanced) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -18817,42 +18804,42 @@ impl<'de> serde::Deserialize<'de> for TrackEgressRequest { formatter.write_str("struct livekit.TrackEgressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room_name__ = None; let mut track_id__ = None; let mut output__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::TrackId => { if track_id__.is_some() { return Err(serde::de::Error::duplicate_field("trackId")); } - track_id__ = Some(map.next_value()?); + track_id__ = Some(map_.next_value()?); } GeneratedField::File => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("file")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(track_egress_request::Output::File) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_egress_request::Output::File) ; } GeneratedField::WebsocketUrl => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("websocketUrl")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(track_egress_request::Output::WebsocketUrl); + output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_egress_request::Output::WebsocketUrl); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -18933,8 +18920,8 @@ impl serde::Serialize for TrackInfo { struct_ser.serialize_field("sid", &self.sid)?; } if self.r#type != 0 { - let v = TrackType::from_i32(self.r#type) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; + let v = TrackType::try_from(self.r#type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; struct_ser.serialize_field("type", &v)?; } if !self.name.is_empty() { @@ -18956,8 +18943,8 @@ impl serde::Serialize for TrackInfo { struct_ser.serialize_field("disableDtx", &self.disable_dtx)?; } if self.source != 0 { - let v = TrackSource::from_i32(self.source) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; + let v = TrackSource::try_from(self.source) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; struct_ser.serialize_field("source", &v)?; } if !self.layers.is_empty() { @@ -18979,8 +18966,8 @@ impl serde::Serialize for TrackInfo { struct_ser.serialize_field("disableRed", &self.disable_red)?; } if self.encryption != 0 { - let v = encryption::Type::from_i32(self.encryption) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.encryption)))?; + let v = encryption::Type::try_from(self.encryption) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.encryption)))?; struct_ser.serialize_field("encryption", &v)?; } if !self.stream.is_empty() { @@ -19097,7 +19084,7 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { formatter.write_str("struct livekit.TrackInfo") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -19119,38 +19106,38 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { let mut encryption__ = None; let mut stream__ = None; let mut version__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Sid => { if sid__.is_some() { return Err(serde::de::Error::duplicate_field("sid")); } - sid__ = Some(map.next_value()?); + sid__ = Some(map_.next_value()?); } GeneratedField::Type => { if r#type__.is_some() { return Err(serde::de::Error::duplicate_field("type")); } - r#type__ = Some(map.next_value::()? as i32); + r#type__ = Some(map_.next_value::()? as i32); } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::Muted => { if muted__.is_some() { return Err(serde::de::Error::duplicate_field("muted")); } - muted__ = Some(map.next_value()?); + muted__ = Some(map_.next_value()?); } GeneratedField::Width => { if width__.is_some() { return Err(serde::de::Error::duplicate_field("width")); } width__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Height => { @@ -19158,83 +19145,83 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { return Err(serde::de::Error::duplicate_field("height")); } height__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Simulcast => { if simulcast__.is_some() { return Err(serde::de::Error::duplicate_field("simulcast")); } - simulcast__ = Some(map.next_value()?); + simulcast__ = Some(map_.next_value()?); } GeneratedField::DisableDtx => { if disable_dtx__.is_some() { return Err(serde::de::Error::duplicate_field("disableDtx")); } - disable_dtx__ = Some(map.next_value()?); + disable_dtx__ = Some(map_.next_value()?); } GeneratedField::Source => { if source__.is_some() { return Err(serde::de::Error::duplicate_field("source")); } - source__ = Some(map.next_value::()? as i32); + source__ = Some(map_.next_value::()? as i32); } GeneratedField::Layers => { if layers__.is_some() { return Err(serde::de::Error::duplicate_field("layers")); } - layers__ = Some(map.next_value()?); + layers__ = Some(map_.next_value()?); } GeneratedField::MimeType => { if mime_type__.is_some() { return Err(serde::de::Error::duplicate_field("mimeType")); } - mime_type__ = Some(map.next_value()?); + mime_type__ = Some(map_.next_value()?); } GeneratedField::Mid => { if mid__.is_some() { return Err(serde::de::Error::duplicate_field("mid")); } - mid__ = Some(map.next_value()?); + mid__ = Some(map_.next_value()?); } GeneratedField::Codecs => { if codecs__.is_some() { return Err(serde::de::Error::duplicate_field("codecs")); } - codecs__ = Some(map.next_value()?); + codecs__ = Some(map_.next_value()?); } GeneratedField::Stereo => { if stereo__.is_some() { return Err(serde::de::Error::duplicate_field("stereo")); } - stereo__ = Some(map.next_value()?); + stereo__ = Some(map_.next_value()?); } GeneratedField::DisableRed => { if disable_red__.is_some() { return Err(serde::de::Error::duplicate_field("disableRed")); } - disable_red__ = Some(map.next_value()?); + disable_red__ = Some(map_.next_value()?); } GeneratedField::Encryption => { if encryption__.is_some() { return Err(serde::de::Error::duplicate_field("encryption")); } - encryption__ = Some(map.next_value::()? as i32); + encryption__ = Some(map_.next_value::()? as i32); } GeneratedField::Stream => { if stream__.is_some() { return Err(serde::de::Error::duplicate_field("stream")); } - stream__ = Some(map.next_value()?); + stream__ = Some(map_.next_value()?); } GeneratedField::Version => { if version__.is_some() { return Err(serde::de::Error::duplicate_field("version")); } - version__ = map.next_value()?; + version__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -19363,7 +19350,7 @@ impl<'de> serde::Deserialize<'de> for TrackPermission { formatter.write_str("struct livekit.TrackPermission") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -19371,34 +19358,34 @@ impl<'de> serde::Deserialize<'de> for TrackPermission { let mut all_tracks__ = None; let mut track_sids__ = None; let mut participant_identity__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::ParticipantSid => { if participant_sid__.is_some() { return Err(serde::de::Error::duplicate_field("participantSid")); } - participant_sid__ = Some(map.next_value()?); + participant_sid__ = Some(map_.next_value()?); } GeneratedField::AllTracks => { if all_tracks__.is_some() { return Err(serde::de::Error::duplicate_field("allTracks")); } - all_tracks__ = Some(map.next_value()?); + all_tracks__ = Some(map_.next_value()?); } GeneratedField::TrackSids => { if track_sids__.is_some() { return Err(serde::de::Error::duplicate_field("trackSids")); } - track_sids__ = Some(map.next_value()?); + track_sids__ = Some(map_.next_value()?); } GeneratedField::ParticipantIdentity => { if participant_identity__.is_some() { return Err(serde::de::Error::duplicate_field("participantIdentity")); } - participant_identity__ = Some(map.next_value()?); + participant_identity__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -19491,28 +19478,28 @@ impl<'de> serde::Deserialize<'de> for TrackPublishedResponse { formatter.write_str("struct livekit.TrackPublishedResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut cid__ = None; let mut track__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Cid => { if cid__.is_some() { return Err(serde::de::Error::duplicate_field("cid")); } - cid__ = Some(map.next_value()?); + cid__ = Some(map_.next_value()?); } GeneratedField::Track => { if track__.is_some() { return Err(serde::de::Error::duplicate_field("track")); } - track__ = map.next_value()?; + track__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -19568,10 +19555,9 @@ impl<'de> serde::Deserialize<'de> for TrackSource { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(TrackSource::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -19581,10 +19567,9 @@ impl<'de> serde::Deserialize<'de> for TrackSource { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(TrackSource::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -19646,10 +19631,9 @@ impl<'de> serde::Deserialize<'de> for TrackType { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(TrackType::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -19659,10 +19643,9 @@ impl<'de> serde::Deserialize<'de> for TrackType { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(TrackType::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -19753,21 +19736,21 @@ impl<'de> serde::Deserialize<'de> for TrackUnpublishedResponse { formatter.write_str("struct livekit.TrackUnpublishedResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut track_sid__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::TrackSid => { if track_sid__.is_some() { return Err(serde::de::Error::duplicate_field("trackSid")); } - track_sid__ = Some(map.next_value()?); + track_sid__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -19798,8 +19781,8 @@ impl serde::Serialize for TrickleRequest { struct_ser.serialize_field("candidateInit", &self.candidate_init)?; } if self.target != 0 { - let v = SignalTarget::from_i32(self.target) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.target)))?; + let v = SignalTarget::try_from(self.target) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.target)))?; struct_ser.serialize_field("target", &v)?; } struct_ser.end() @@ -19859,28 +19842,28 @@ impl<'de> serde::Deserialize<'de> for TrickleRequest { formatter.write_str("struct livekit.TrickleRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut candidate_init__ = None; let mut target__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::CandidateInit => { if candidate_init__.is_some() { return Err(serde::de::Error::duplicate_field("candidateInit")); } - candidate_init__ = Some(map.next_value()?); + candidate_init__ = Some(map_.next_value()?); } GeneratedField::Target => { if target__.is_some() { return Err(serde::de::Error::duplicate_field("target")); } - target__ = Some(map.next_value::()? as i32); + target__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -20030,7 +20013,7 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { formatter.write_str("struct livekit.UpdateIngressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -20042,58 +20025,58 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { let mut bypass_transcoding__ = None; let mut audio__ = None; let mut video__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::IngressId => { if ingress_id__.is_some() { return Err(serde::de::Error::duplicate_field("ingressId")); } - ingress_id__ = Some(map.next_value()?); + ingress_id__ = Some(map_.next_value()?); } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); } - room_name__ = Some(map.next_value()?); + room_name__ = Some(map_.next_value()?); } GeneratedField::ParticipantIdentity => { if participant_identity__.is_some() { return Err(serde::de::Error::duplicate_field("participantIdentity")); } - participant_identity__ = Some(map.next_value()?); + participant_identity__ = Some(map_.next_value()?); } GeneratedField::ParticipantName => { if participant_name__.is_some() { return Err(serde::de::Error::duplicate_field("participantName")); } - participant_name__ = Some(map.next_value()?); + participant_name__ = Some(map_.next_value()?); } GeneratedField::BypassTranscoding => { if bypass_transcoding__.is_some() { return Err(serde::de::Error::duplicate_field("bypassTranscoding")); } - bypass_transcoding__ = map.next_value()?; + bypass_transcoding__ = map_.next_value()?; } GeneratedField::Audio => { if audio__.is_some() { return Err(serde::de::Error::duplicate_field("audio")); } - audio__ = map.next_value()?; + audio__ = map_.next_value()?; } GeneratedField::Video => { if video__.is_some() { return Err(serde::de::Error::duplicate_field("video")); } - video__ = map.next_value()?; + video__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -20191,28 +20174,28 @@ impl<'de> serde::Deserialize<'de> for UpdateLayoutRequest { formatter.write_str("struct livekit.UpdateLayoutRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut egress_id__ = None; let mut layout__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::EgressId => { if egress_id__.is_some() { return Err(serde::de::Error::duplicate_field("egressId")); } - egress_id__ = Some(map.next_value()?); + egress_id__ = Some(map_.next_value()?); } GeneratedField::Layout => { if layout__.is_some() { return Err(serde::de::Error::duplicate_field("layout")); } - layout__ = Some(map.next_value()?); + layout__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -20303,28 +20286,28 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { formatter.write_str("struct livekit.UpdateParticipantMetadata") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut metadata__ = None; let mut name__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Metadata => { if metadata__.is_some() { return Err(serde::de::Error::duplicate_field("metadata")); } - metadata__ = Some(map.next_value()?); + metadata__ = Some(map_.next_value()?); } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -20442,7 +20425,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { formatter.write_str("struct livekit.UpdateParticipantRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -20451,40 +20434,40 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { let mut metadata__ = None; let mut permission__ = None; let mut name__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::Identity => { if identity__.is_some() { return Err(serde::de::Error::duplicate_field("identity")); } - identity__ = Some(map.next_value()?); + identity__ = Some(map_.next_value()?); } GeneratedField::Metadata => { if metadata__.is_some() { return Err(serde::de::Error::duplicate_field("metadata")); } - metadata__ = Some(map.next_value()?); + metadata__ = Some(map_.next_value()?); } GeneratedField::Permission => { if permission__.is_some() { return Err(serde::de::Error::duplicate_field("permission")); } - permission__ = map.next_value()?; + permission__ = map_.next_value()?; } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); } - name__ = Some(map.next_value()?); + name__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -20578,28 +20561,28 @@ impl<'de> serde::Deserialize<'de> for UpdateRoomMetadataRequest { formatter.write_str("struct livekit.UpdateRoomMetadataRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut room__ = None; let mut metadata__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::Metadata => { if metadata__.is_some() { return Err(serde::de::Error::duplicate_field("metadata")); } - metadata__ = Some(map.next_value()?); + metadata__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -20702,35 +20685,35 @@ impl<'de> serde::Deserialize<'de> for UpdateStreamRequest { formatter.write_str("struct livekit.UpdateStreamRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut egress_id__ = None; let mut add_output_urls__ = None; let mut remove_output_urls__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::EgressId => { if egress_id__.is_some() { return Err(serde::de::Error::duplicate_field("egressId")); } - egress_id__ = Some(map.next_value()?); + egress_id__ = Some(map_.next_value()?); } GeneratedField::AddOutputUrls => { if add_output_urls__.is_some() { return Err(serde::de::Error::duplicate_field("addOutputUrls")); } - add_output_urls__ = Some(map.next_value()?); + add_output_urls__ = Some(map_.next_value()?); } GeneratedField::RemoveOutputUrls => { if remove_output_urls__.is_some() { return Err(serde::de::Error::duplicate_field("removeOutputUrls")); } - remove_output_urls__ = Some(map.next_value()?); + remove_output_urls__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -20833,35 +20816,35 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscription { formatter.write_str("struct livekit.UpdateSubscription") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut track_sids__ = None; let mut subscribe__ = None; let mut participant_tracks__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::TrackSids => { if track_sids__.is_some() { return Err(serde::de::Error::duplicate_field("trackSids")); } - track_sids__ = Some(map.next_value()?); + track_sids__ = Some(map_.next_value()?); } GeneratedField::Subscribe => { if subscribe__.is_some() { return Err(serde::de::Error::duplicate_field("subscribe")); } - subscribe__ = Some(map.next_value()?); + subscribe__ = Some(map_.next_value()?); } GeneratedField::ParticipantTracks => { if participant_tracks__.is_some() { return Err(serde::de::Error::duplicate_field("participantTracks")); } - participant_tracks__ = Some(map.next_value()?); + participant_tracks__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -20982,7 +20965,7 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsRequest { formatter.write_str("struct livekit.UpdateSubscriptionsRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -20991,40 +20974,40 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsRequest { let mut track_sids__ = None; let mut subscribe__ = None; let mut participant_tracks__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::Identity => { if identity__.is_some() { return Err(serde::de::Error::duplicate_field("identity")); } - identity__ = Some(map.next_value()?); + identity__ = Some(map_.next_value()?); } GeneratedField::TrackSids => { if track_sids__.is_some() { return Err(serde::de::Error::duplicate_field("trackSids")); } - track_sids__ = Some(map.next_value()?); + track_sids__ = Some(map_.next_value()?); } GeneratedField::Subscribe => { if subscribe__.is_some() { return Err(serde::de::Error::duplicate_field("subscribe")); } - subscribe__ = Some(map.next_value()?); + subscribe__ = Some(map_.next_value()?); } GeneratedField::ParticipantTracks => { if participant_tracks__.is_some() { return Err(serde::de::Error::duplicate_field("participantTracks")); } - participant_tracks__ = Some(map.next_value()?); + participant_tracks__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -21098,12 +21081,12 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsResponse { formatter.write_str("struct livekit.UpdateSubscriptionsResponse") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - while map.next_key::()?.is_some() { - let _ = map.next_value::()?; + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } Ok(UpdateSubscriptionsResponse { }) @@ -21149,8 +21132,8 @@ impl serde::Serialize for UpdateTrackSettings { struct_ser.serialize_field("disabled", &self.disabled)?; } if self.quality != 0 { - let v = VideoQuality::from_i32(self.quality) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; + let v = VideoQuality::try_from(self.quality) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; struct_ser.serialize_field("quality", &v)?; } if self.width != 0 { @@ -21238,7 +21221,7 @@ impl<'de> serde::Deserialize<'de> for UpdateTrackSettings { formatter.write_str("struct livekit.UpdateTrackSettings") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -21249,32 +21232,32 @@ impl<'de> serde::Deserialize<'de> for UpdateTrackSettings { let mut height__ = None; let mut fps__ = None; let mut priority__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::TrackSids => { if track_sids__.is_some() { return Err(serde::de::Error::duplicate_field("trackSids")); } - track_sids__ = Some(map.next_value()?); + track_sids__ = Some(map_.next_value()?); } GeneratedField::Disabled => { if disabled__.is_some() { return Err(serde::de::Error::duplicate_field("disabled")); } - disabled__ = Some(map.next_value()?); + disabled__ = Some(map_.next_value()?); } GeneratedField::Quality => { if quality__.is_some() { return Err(serde::de::Error::duplicate_field("quality")); } - quality__ = Some(map.next_value::()? as i32); + quality__ = Some(map_.next_value::()? as i32); } GeneratedField::Width => { if width__.is_some() { return Err(serde::de::Error::duplicate_field("width")); } width__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Height => { @@ -21282,7 +21265,7 @@ impl<'de> serde::Deserialize<'de> for UpdateTrackSettings { return Err(serde::de::Error::duplicate_field("height")); } height__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Fps => { @@ -21290,7 +21273,7 @@ impl<'de> serde::Deserialize<'de> for UpdateTrackSettings { return Err(serde::de::Error::duplicate_field("fps")); } fps__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Priority => { @@ -21298,11 +21281,11 @@ impl<'de> serde::Deserialize<'de> for UpdateTrackSettings { return Err(serde::de::Error::duplicate_field("priority")); } priority__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -21399,28 +21382,28 @@ impl<'de> serde::Deserialize<'de> for UpdateVideoLayers { formatter.write_str("struct livekit.UpdateVideoLayers") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut track_sid__ = None; let mut layers__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::TrackSid => { if track_sid__.is_some() { return Err(serde::de::Error::duplicate_field("trackSid")); } - track_sid__ = Some(map.next_value()?); + track_sid__ = Some(map_.next_value()?); } GeneratedField::Layers => { if layers__.is_some() { return Err(serde::de::Error::duplicate_field("layers")); } - layers__ = Some(map.next_value()?); + layers__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -21467,6 +21450,7 @@ impl serde::Serialize for UserPacket { struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; } if !self.payload.is_empty() { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("payload", pbjson::private::base64::encode(&self.payload).as_str())?; } if !self.destination_sids.is_empty() { @@ -21551,7 +21535,7 @@ impl<'de> serde::Deserialize<'de> for UserPacket { formatter.write_str("struct livekit.UserPacket") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -21561,48 +21545,48 @@ impl<'de> serde::Deserialize<'de> for UserPacket { let mut destination_sids__ = None; let mut destination_identities__ = None; let mut topic__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::ParticipantSid => { if participant_sid__.is_some() { return Err(serde::de::Error::duplicate_field("participantSid")); } - participant_sid__ = Some(map.next_value()?); + participant_sid__ = Some(map_.next_value()?); } GeneratedField::ParticipantIdentity => { if participant_identity__.is_some() { return Err(serde::de::Error::duplicate_field("participantIdentity")); } - participant_identity__ = Some(map.next_value()?); + participant_identity__ = Some(map_.next_value()?); } GeneratedField::Payload => { if payload__.is_some() { return Err(serde::de::Error::duplicate_field("payload")); } payload__ = - Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) ; } GeneratedField::DestinationSids => { if destination_sids__.is_some() { return Err(serde::de::Error::duplicate_field("destinationSids")); } - destination_sids__ = Some(map.next_value()?); + destination_sids__ = Some(map_.next_value()?); } GeneratedField::DestinationIdentities => { if destination_identities__.is_some() { return Err(serde::de::Error::duplicate_field("destinationIdentities")); } - destination_identities__ = Some(map.next_value()?); + destination_identities__ = Some(map_.next_value()?); } GeneratedField::Topic => { if topic__.is_some() { return Err(serde::de::Error::duplicate_field("topic")); } - topic__ = map.next_value()?; + topic__ = map_.next_value()?; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -21662,10 +21646,9 @@ impl<'de> serde::Deserialize<'de> for VideoCodec { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(VideoCodec::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -21675,10 +21658,9 @@ impl<'de> serde::Deserialize<'de> for VideoCodec { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(VideoCodec::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -21714,8 +21696,8 @@ impl serde::Serialize for VideoConfiguration { } let mut struct_ser = serializer.serialize_struct("livekit.VideoConfiguration", len)?; if self.hardware_encoder != 0 { - let v = ClientConfigSetting::from_i32(self.hardware_encoder) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.hardware_encoder)))?; + let v = ClientConfigSetting::try_from(self.hardware_encoder) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.hardware_encoder)))?; struct_ser.serialize_field("hardwareEncoder", &v)?; } struct_ser.end() @@ -21773,21 +21755,21 @@ impl<'de> serde::Deserialize<'de> for VideoConfiguration { formatter.write_str("struct livekit.VideoConfiguration") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut hardware_encoder__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::HardwareEncoder => { if hardware_encoder__.is_some() { return Err(serde::de::Error::duplicate_field("hardwareEncoder")); } - hardware_encoder__ = Some(map.next_value::()? as i32); + hardware_encoder__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -21824,8 +21806,8 @@ impl serde::Serialize for VideoLayer { } let mut struct_ser = serializer.serialize_struct("livekit.VideoLayer", len)?; if self.quality != 0 { - let v = VideoQuality::from_i32(self.quality) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; + let v = VideoQuality::try_from(self.quality) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; struct_ser.serialize_field("quality", &v)?; } if self.width != 0 { @@ -21906,7 +21888,7 @@ impl<'de> serde::Deserialize<'de> for VideoLayer { formatter.write_str("struct livekit.VideoLayer") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -21915,20 +21897,20 @@ impl<'de> serde::Deserialize<'de> for VideoLayer { let mut height__ = None; let mut bitrate__ = None; let mut ssrc__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Quality => { if quality__.is_some() { return Err(serde::de::Error::duplicate_field("quality")); } - quality__ = Some(map.next_value::()? as i32); + quality__ = Some(map_.next_value::()? as i32); } GeneratedField::Width => { if width__.is_some() { return Err(serde::de::Error::duplicate_field("width")); } width__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Height => { @@ -21936,7 +21918,7 @@ impl<'de> serde::Deserialize<'de> for VideoLayer { return Err(serde::de::Error::duplicate_field("height")); } height__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Bitrate => { @@ -21944,7 +21926,7 @@ impl<'de> serde::Deserialize<'de> for VideoLayer { return Err(serde::de::Error::duplicate_field("bitrate")); } bitrate__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Ssrc => { @@ -21952,11 +21934,11 @@ impl<'de> serde::Deserialize<'de> for VideoLayer { return Err(serde::de::Error::duplicate_field("ssrc")); } ssrc__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -22013,10 +21995,9 @@ impl<'de> serde::Deserialize<'de> for VideoQuality { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(VideoQuality::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -22026,10 +22007,9 @@ impl<'de> serde::Deserialize<'de> for VideoQuality { where E: serde::de::Error, { - use std::convert::TryFrom; i32::try_from(v) .ok() - .and_then(VideoQuality::from_i32) + .and_then(|x| x.try_into().ok()) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -22130,8 +22110,8 @@ impl serde::Serialize for WebEgressRequest { if let Some(v) = self.options.as_ref() { match v { web_egress_request::Options::Preset(v) => { - let v = EncodingOptionsPreset::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + let v = EncodingOptionsPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("preset", &v)?; } web_egress_request::Options::Advanced(v) => { @@ -22236,7 +22216,7 @@ impl<'de> serde::Deserialize<'de> for WebEgressRequest { formatter.write_str("struct livekit.WebEgressRequest") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -22250,92 +22230,92 @@ impl<'de> serde::Deserialize<'de> for WebEgressRequest { let mut image_outputs__ = None; let mut output__ = None; let mut options__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Url => { if url__.is_some() { return Err(serde::de::Error::duplicate_field("url")); } - url__ = Some(map.next_value()?); + url__ = Some(map_.next_value()?); } GeneratedField::AudioOnly => { if audio_only__.is_some() { return Err(serde::de::Error::duplicate_field("audioOnly")); } - audio_only__ = Some(map.next_value()?); + audio_only__ = Some(map_.next_value()?); } GeneratedField::VideoOnly => { if video_only__.is_some() { return Err(serde::de::Error::duplicate_field("videoOnly")); } - video_only__ = Some(map.next_value()?); + video_only__ = Some(map_.next_value()?); } GeneratedField::AwaitStartSignal => { if await_start_signal__.is_some() { return Err(serde::de::Error::duplicate_field("awaitStartSignal")); } - await_start_signal__ = Some(map.next_value()?); + await_start_signal__ = Some(map_.next_value()?); } GeneratedField::FileOutputs => { if file_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("fileOutputs")); } - file_outputs__ = Some(map.next_value()?); + file_outputs__ = Some(map_.next_value()?); } GeneratedField::StreamOutputs => { if stream_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("streamOutputs")); } - stream_outputs__ = Some(map.next_value()?); + stream_outputs__ = Some(map_.next_value()?); } GeneratedField::SegmentOutputs => { if segment_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("segmentOutputs")); } - segment_outputs__ = Some(map.next_value()?); + segment_outputs__ = Some(map_.next_value()?); } GeneratedField::ImageOutputs => { if image_outputs__.is_some() { return Err(serde::de::Error::duplicate_field("imageOutputs")); } - image_outputs__ = Some(map.next_value()?); + image_outputs__ = Some(map_.next_value()?); } GeneratedField::File => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("file")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::File) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::File) ; } GeneratedField::Stream => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("stream")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::Stream) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::Stream) ; } GeneratedField::Segments => { if output__.is_some() { return Err(serde::de::Error::duplicate_field("segments")); } - output__ = map.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::Segments) + output__ = map_.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::Segments) ; } GeneratedField::Preset => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("preset")); } - options__ = map.next_value::<::std::option::Option>()?.map(|x| web_egress_request::Options::Preset(x as i32)); + options__ = map_.next_value::<::std::option::Option>()?.map(|x| web_egress_request::Options::Preset(x as i32)); } GeneratedField::Advanced => { if options__.is_some() { return Err(serde::de::Error::duplicate_field("advanced")); } - options__ = map.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Options::Advanced) + options__ = map_.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Options::Advanced) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } } @@ -22414,6 +22394,7 @@ impl serde::Serialize for WebhookEvent { struct_ser.serialize_field("id", &self.id)?; } if self.created_at != 0 { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field("createdAt", ToString::to_string(&self.created_at).as_str())?; } if self.num_dropped != 0 { @@ -22501,7 +22482,7 @@ impl<'de> serde::Deserialize<'de> for WebhookEvent { formatter.write_str("struct livekit.WebhookEvent") } - fn visit_map(self, mut map: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -22514,56 +22495,56 @@ impl<'de> serde::Deserialize<'de> for WebhookEvent { let mut id__ = None; let mut created_at__ = None; let mut num_dropped__ = None; - while let Some(k) = map.next_key()? { + while let Some(k) = map_.next_key()? { match k { GeneratedField::Event => { if event__.is_some() { return Err(serde::de::Error::duplicate_field("event")); } - event__ = Some(map.next_value()?); + event__ = Some(map_.next_value()?); } GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = map.next_value()?; + room__ = map_.next_value()?; } GeneratedField::Participant => { if participant__.is_some() { return Err(serde::de::Error::duplicate_field("participant")); } - participant__ = map.next_value()?; + participant__ = map_.next_value()?; } GeneratedField::EgressInfo => { if egress_info__.is_some() { return Err(serde::de::Error::duplicate_field("egressInfo")); } - egress_info__ = map.next_value()?; + egress_info__ = map_.next_value()?; } GeneratedField::IngressInfo => { if ingress_info__.is_some() { return Err(serde::de::Error::duplicate_field("ingressInfo")); } - ingress_info__ = map.next_value()?; + ingress_info__ = map_.next_value()?; } GeneratedField::Track => { if track__.is_some() { return Err(serde::de::Error::duplicate_field("track")); } - track__ = map.next_value()?; + track__ = map_.next_value()?; } GeneratedField::Id => { if id__.is_some() { return Err(serde::de::Error::duplicate_field("id")); } - id__ = Some(map.next_value()?); + id__ = Some(map_.next_value()?); } GeneratedField::CreatedAt => { if created_at__.is_some() { return Err(serde::de::Error::duplicate_field("createdAt")); } created_at__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::NumDropped => { @@ -22571,11 +22552,11 @@ impl<'de> serde::Deserialize<'de> for WebhookEvent { return Err(serde::de::Error::duplicate_field("numDropped")); } num_dropped__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { - let _ = map.next_value::()?; + let _ = map_.next_value::()?; } } }