[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
parent
01e7d3e560
commit
b5f6a082dd
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue