Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Dec 25, 2023
1 parent 06556c9 commit 21e0715
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions crates/voicevox_core/src/engine/morph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,21 @@ mod permission {
pub(super) fn new(
pair: MorphingPair<(StyleId, &'speakers SpeakerMeta)>,
) -> std::result::Result<Self, MorphError> {
match pair.map(|(_, speaker)| speaker.supported_features().permitted_synthesis_morphing)
{
match pair.map(|(_, speaker)| {
(
speaker.supported_features().permitted_synthesis_morphing,
speaker.speaker_uuid(),
)
}) {
MorphingPair {
base: PermittedSynthesisMorphing::All,
target: PermittedSynthesisMorphing::All,
base: (PermittedSynthesisMorphing::All, _),
target: (PermittedSynthesisMorphing::All, _),
} => {}

MorphingPair {
base: PermittedSynthesisMorphing::SelfOnly,
target: PermittedSynthesisMorphing::SelfOnly,
} if pair.base.1.speaker_uuid() == pair.target.1.speaker_uuid() => {}
base: (PermittedSynthesisMorphing::SelfOnly, base_speaker_uuid),
target: (PermittedSynthesisMorphing::SelfOnly, target_speaker_uuid),
} if base_speaker_uuid == target_speaker_uuid => {}

_ => return Err(MorphError),
}
Expand Down

0 comments on commit 21e0715

Please sign in to comment.