code: func (e *EncryptedRaftLogger) SaveSnapshot(snapshot raftpb.Snapshot) error {
  
  	walsnap := walpb.Snapshot{
  		Index: snapshot.Metadata.Index,
  		Term:  snapshot.Metadata.Term,
  	}
  
  	e.encoderMu.RLock()
  	if err := e.wal.SaveSnapshot(walsnap); err != nil {
  		e.encoderMu.RUnlock()
  		return err
  	}
  
  	snapshotter := e.snapshotter
  	e.encoderMu.RUnlock()
  
  	if err := snapshotter.SaveSnap(snapshot); err != nil {
  		return err
  	}
  	return e.wal.ReleaseLockTo(snapshot.Metadata.Index)
  }
docs: // SaveSnapshot actually saves a given snapshot to both the WAL and the snapshot.