// IsLearnerOrDemotingVoter judges whether peer role will become Learner.
// The peer is not nil and the role is equal to DemotingVoter or Learner.
IsLearnerOrDemotingVoter judges whether peer role will become Learner.
The peer is not nil and the role is equal to DemotingVoter or Learner.
// IsLearnerOrDemotingVoter judges whether peer role will become Learner . // The peer is not nil and the role is equal to DemotingVoter or Learner .
func IsLearnerOrDemotingVoter(peer *metapb.Peer) bool {
	if peer == nil {
		return false
	}
	switch peer.GetRole() {
	case metapb.PeerRole_DemotingVoter, metapb.PeerRole_Learner:
		return true
	}
	return false
}
func IsLearnerOrDemotingVoter ( peer * metapb . Peer ) bool { if peer == nil { return false } switch peer . GetRole ( ) { case metapb . PeerRole_DemotingVoter , metapb . PeerRole_Learner : return true } return false }
IsLearnerOrDemotingVoter judges whether peer role will become Learner.
IsLearnerOrDemotingVoter judges whether peer role will become Learner .