@@ -23,22 +23,22 @@ use std::ptr;
2323///
2424/// Two `Optional`s are equal if they match both presence and the field values.
2525#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
26- pub enum Optional < SetVal , UnsetVal = SetVal > {
26+ pub enum Optional < T > {
2727 /// The field is set; it is present in the serialized message.
2828 ///
2929 /// - For an `_opt()` accessor, this contains a `View<impl Proxied>`.
3030 /// - For a `_mut()` accessor, this contains a [`PresentField`] that can be
3131 /// used to access the current value, convert to [`Mut`], clear presence,
3232 /// or set a new value.
33- Set ( SetVal ) ,
33+ Set ( T ) ,
3434
3535 /// The field is unset; it is absent in the serialized message.
3636 ///
3737 /// - For an `_opt()` accessor, this contains a `View<impl Proxied>` with
3838 /// the default value.
3939 /// - For a `_mut()` accessor, this contains an [`AbsentField`] that can be
4040 /// used to access the default or set a new value.
41- Unset ( UnsetVal ) ,
41+ Unset ( T ) ,
4242}
4343
4444impl < T > Optional < T > {
@@ -53,9 +53,7 @@ impl<T> Optional<T> {
5353 pub fn new ( val : T , is_set : bool ) -> Self {
5454 if is_set { Optional :: Set ( val) } else { Optional :: Unset ( val) }
5555 }
56- }
5756
58- impl < T , A > Optional < T , A > {
5957 /// Converts into an `Option` of the set value, ignoring any unset value.
6058 pub fn into_option ( self ) -> Option < T > {
6159 if let Optional :: Set ( x) = self { Some ( x) } else { None }
0 commit comments