summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5df59f4..7a14d3c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -125,6 +125,13 @@ impl IntcodeProgram {
.unwrap()
}
+ pub fn output_into_result(&self) -> Result<Vector<Intcode>, IntcodeProgramError> {
+ match self.error {
+ Some(ref error) => Err(error.clone()),
+ None => Ok(self.output.clone()),
+ }
+ }
+
fn with_instruction_pointer(&self, instruction_pointer: Intcode) -> IntcodeProgram {
IntcodeProgram {
instruction_pointer,
@@ -170,13 +177,6 @@ impl IntcodeProgram {
}
}
- fn output_into_result(&self) -> Result<Vector<Intcode>, IntcodeProgramError> {
- match self.error {
- Some(ref error) => Err(error.clone()),
- None => Ok(self.output.clone()),
- }
- }
-
fn memory_0_into_result(&self) -> Result<Intcode, IntcodeProgramError> {
match self.error {
Some(ref error) => Err(error.clone()),