@@ -10,7 +10,6 @@ use alloc::{collections::vec_deque::VecDeque, string::String};
1010use core:: {
1111 fmt:: Debug ,
1212 marker:: PhantomData ,
13- mem,
1413 mem:: MaybeUninit ,
1514 ptr:: addr_of,
1615 task:: Poll ,
@@ -781,100 +780,6 @@ impl Config {
781780 Config :: EapClient ( eap_client_configuration) => eap_client_configuration. validate ( ) ,
782781 }
783782 }
784-
785- /// Returns a reference to the client configuration if available.
786- pub fn as_client_conf_ref ( & self ) -> Option < & ClientConfig > {
787- match self {
788- Self :: Client ( client_conf) => Some ( client_conf) ,
789- Self :: ApSta ( client_conf, _) => Some ( client_conf) ,
790- _ => None ,
791- }
792- }
793-
794- /// Returns a reference to the access point configuration if available.
795- pub fn as_ap_conf_ref ( & self ) -> Option < & AccessPointConfig > {
796- match self {
797- Self :: AccessPoint ( ap_conf) => Some ( ap_conf) ,
798- Self :: ApSta ( _, ap_conf) => Some ( ap_conf) ,
799- _ => None ,
800- }
801- }
802-
803- /// Returns a mutable reference to the client configuration, creating it if
804- /// necessary.
805- pub fn as_client_conf_mut ( & mut self ) -> & mut ClientConfig {
806- match self {
807- Self :: Client ( client_conf) => client_conf,
808- Self :: ApSta ( _, _) => {
809- let prev = mem:: replace ( self , Self :: None ) ;
810- match prev {
811- Self :: ApSta ( client_conf, _) => {
812- * self = Self :: Client ( client_conf) ;
813- self . as_client_conf_mut ( )
814- }
815- _ => unreachable ! ( ) ,
816- }
817- }
818- _ => {
819- * self = Self :: Client ( Default :: default ( ) ) ;
820- self . as_client_conf_mut ( )
821- }
822- }
823- }
824-
825- /// Returns a mutable reference to the access point configuration, creating
826- /// it if necessary.
827- pub fn as_ap_conf_mut ( & mut self ) -> & mut AccessPointConfig {
828- match self {
829- Self :: AccessPoint ( ap_conf) => ap_conf,
830- Self :: ApSta ( _, _) => {
831- let prev = mem:: replace ( self , Self :: None ) ;
832- match prev {
833- Self :: ApSta ( _, ap_conf) => {
834- * self = Self :: AccessPoint ( ap_conf) ;
835- self . as_ap_conf_mut ( )
836- }
837- _ => unreachable ! ( ) ,
838- }
839- }
840- _ => {
841- * self = Self :: AccessPoint ( Default :: default ( ) ) ;
842- self . as_ap_conf_mut ( )
843- }
844- }
845- }
846-
847- /// Retrieves mutable references to both the `ClientConfig`
848- /// and `AccessPointConfig`.
849- pub fn as_mixed_conf_mut ( & mut self ) -> ( & mut ClientConfig , & mut AccessPointConfig ) {
850- match self {
851- Self :: ApSta ( client_conf, ap_conf) => ( client_conf, ap_conf) ,
852- Self :: AccessPoint ( _) => {
853- let prev = mem:: replace ( self , Self :: None ) ;
854- match prev {
855- Self :: AccessPoint ( ap_conf) => {
856- * self = Self :: ApSta ( Default :: default ( ) , ap_conf) ;
857- self . as_mixed_conf_mut ( )
858- }
859- _ => unreachable ! ( ) ,
860- }
861- }
862- Self :: Client ( _) => {
863- let prev = mem:: replace ( self , Self :: None ) ;
864- match prev {
865- Self :: Client ( client_conf) => {
866- * self = Self :: ApSta ( client_conf, Default :: default ( ) ) ;
867- self . as_mixed_conf_mut ( )
868- }
869- _ => unreachable ! ( ) ,
870- }
871- }
872- _ => {
873- * self = Self :: ApSta ( Default :: default ( ) , Default :: default ( ) ) ;
874- self . as_mixed_conf_mut ( )
875- }
876- }
877- }
878783}
879784
880785trait AuthMethodExt {
0 commit comments