Use Vec::split_off

This commit is contained in:
Ben Kimock 2023-03-24 12:34:49 -04:00
parent c9c1346874
commit a71b808d77

View File

@ -111,7 +111,7 @@ fn split_block(
// Drain every statement after this one and move the current terminator to a new basic block
let new_block = BasicBlockData {
statements: block_data.statements.drain(location.statement_index..).collect(),
statements: block_data.statements.split_off(location.statement_index),
terminator: block_data.terminator.take(),
is_cleanup: block_data.is_cleanup,
};