diff options
author | Joseph Frazer <joseph.frazer@ryansg.com> | 2020-03-09 11:41:11 -0400 |
---|---|---|
committer | Joseph Frazer <joseph.frazer@ryansg.com> | 2020-03-09 11:41:11 -0400 |
commit | b5f6a082dd4bb539296ff7d3e5398304fa2d62e2 (patch) | |
tree | 03d05259389fe18809c65273cc94b8d7b42f2c93 | |
parent | 01e7d3e56059fefeb862028e5868f947a042dcd4 (diff) | |
download | tame-b5f6a082dd4bb539296ff7d3e5398304fa2d62e2.tar.gz tame-b5f6a082dd4bb539296ff7d3e5398304fa2d62e2.tar.bz2 tame-b5f6a082dd4bb539296ff7d3e5398304fa2d62e2.zip |
[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.
-rw-r--r-- | tamer/src/ir/asg/base.rs | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/tamer/src/ir/asg/base.rs b/tamer/src/ir/asg/base.rs index a50fe8b..5cedf83 100644 --- a/tamer/src/ir/asg/base.rs +++ b/tamer/src/ir/asg/base.rs @@ -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(()) } |