diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-07-26 11:54:00 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-07-26 11:54:00 +0100 |
| commit | 6e73cc0501e63fe9361b24a20d70a5a18857ef0d (patch) | |
| tree | cdaebd39058bb5e81eb951203a0320561be19fda /src/main/java/org | |
| parent | ef10c39550242ce1dc1ca974c8f01e23ebefd671 (diff) | |
Remove unwrap
Diffstat (limited to 'src/main/java/org')
| -rw-r--r-- | src/main/java/org/zwobble/hobgoblin/compiler/output/generators/rusttransient0/RustTransient0Generator.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/rusttransient0/RustTransient0Generator.java b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/rusttransient0/RustTransient0Generator.java index e37a974..6f8de50 100644 --- a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/rusttransient0/RustTransient0Generator.java +++ b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/rusttransient0/RustTransient0Generator.java @@ -898,7 +898,7 @@ public class RustTransient0Generator implements Generator { new RustBlockExpression( List.of(), Optional.of( - methodCall( + new RustTryPropagationExpression(mapErr( methodCall( new RustCallExpression( RustTypes.ARC.addSegment(RustPathSegment.of("clone")), @@ -913,10 +913,14 @@ public class RustTransient0Generator implements Generator { RustIdentifier.of("downcast"), List.of() ), - // TODO: remove unwrap - RustIdentifier.of("unwrap"), - List.of() - ) + _ -> new RustCallExpression( + RustPath.global("std", "io", "Error", "new"), + List.of( + RustPath.global("std", "io", "ErrorKind", "InvalidData"), + new RustStringLiteral("referenced value has wrong type") + ) + ) + )) ) ), new RustBlockExpression( |
