[DEV-7134] Remove unnecessary node replacement

The node was being replaced before we were catching errors properly. Now
that they are propagated, we should not need the replacement.
master
Joseph Frazer 2020-03-09 11:41:11 -04:00
parent 01e7d3e560
commit b5f6a082dd
1 changed files with 4 additions and 20 deletions

View File

@ -250,15 +250,10 @@ where
);
Ok(ty)
}
_ => {
let err = Err(AsgError::BadFragmentDest(format!(
"identifier is not a Object::Ident): {:?}",
ty,
)));
node.replace(ty);
err
}
_ => Err(AsgError::BadFragmentDest(format!(
"identifier is not a Object::Ident): {:?}",
ty,
))),
}?;
node.replace(result);
@ -645,17 +640,6 @@ mod test {
_ => panic!("expected AsgError::BadFragmentDest: {:?}", err),
}
// Make sure we didn't leave the node in an inconsistent state
assert_eq!(
Some(&Object::IdentFragment(
&sym,
IdentKind::Meta,
Default::default(),
fragment
)),
sut.get(node)
);
Ok(())
}