diff --git a/src/autorouter/invoker.rs b/src/autorouter/invoker.rs index 5331b29..0a5f6d6 100644 --- a/src/autorouter/invoker.rs +++ b/src/autorouter/invoker.rs @@ -253,7 +253,7 @@ impl Invoker { #[debug_requires(self.ongoing_command.is_none())] fn dispatch_command(&mut self, command: &Command) -> Result { - match command { + Ok(match command { Command::Autoroute(selection, options) => { let mut ratlines = self.autorouter.selected_ratlines(selection); @@ -271,23 +271,23 @@ impl Invoker { }); } - Ok::(Execute::Autoroute( + Execute::Autoroute( self.autorouter.autoroute_ratlines(ratlines, *options)?, - )) + ) } - Command::PlaceVia(weight) => { - Ok::(Execute::PlaceVia(self.autorouter.place_via(*weight)?)) - } - Command::RemoveBands(selection) => Ok::(Execute::RemoveBands( + Command::PlaceVia(weight) => Execute::PlaceVia( + self.autorouter.place_via(*weight)? + ), + Command::RemoveBands(selection) => Execute::RemoveBands( self.autorouter.remove_bands(selection)?, - )), - Command::CompareDetours(selection, options) => Ok::( - Execute::CompareDetours(self.autorouter.compare_detours(selection, *options)?), ), - Command::MeasureLength(selection) => Ok::( - Execute::MeasureLength(self.autorouter.measure_length(selection)?), + Command::CompareDetours(selection, options) => Execute::CompareDetours( + self.autorouter.compare_detours(selection, *options)?, ), - } + Command::MeasureLength(selection) => Execute::MeasureLength( + self.autorouter.measure_length(selection)?, + ), + }) } #[debug_requires(self.ongoing_command.is_none())] @@ -308,7 +308,7 @@ impl Invoker { Command::MeasureLength(..) => {} } - Ok::<(), InvokerError>(self.history.undo()?) + Ok(self.history.undo()?) } //#[debug_requires(self.ongoing.is_none())] diff --git a/src/drawing/drawing.rs b/src/drawing/drawing.rs index ff3d8fe..8644c9d 100644 --- a/src/drawing/drawing.rs +++ b/src/drawing/drawing.rs @@ -432,7 +432,7 @@ impl Drawing { return Err(collision.into()); } - Ok::(cane) + Ok(cane) } #[debug_ensures(self.geometry_with_rtree.graph().node_count() == old(self.geometry_with_rtree.graph().node_count()))] @@ -538,7 +538,7 @@ impl Drawing { maybe_rail = self.primitive(rail).outer(); } - Ok::<(), DrawingException>(()) + Ok(()) } #[debug_ensures(ret.is_ok() -> self.geometry_with_rtree.graph().node_count() == old(self.geometry_with_rtree.graph().node_count() + 4))] @@ -606,7 +606,7 @@ impl Drawing { err })?; - Ok::(Cane { + Ok(Cane { seg, dot: seg_to, bend, diff --git a/src/router/draw.rs b/src/router/draw.rs index 8e39ed0..04d3668 100644 --- a/src/router/draw.rs +++ b/src/router/draw.rs @@ -62,7 +62,7 @@ impl<'a, R: AccessRules> Draw<'a, R> { let layer = head.face().primitive(self.layout.drawing()).layer(); let maybe_net = head.face().primitive(self.layout.drawing()).maybe_net(); - Ok::(match head.face() { + Ok(match head.face() { DotIndex::Fixed(dot) => BandTermsegIndex::Straight( self.layout .add_lone_loose_seg( @@ -210,7 +210,7 @@ impl<'a, R: AccessRules> Draw<'a, R> { }, cw, )?; - Ok::(CaneHead { + Ok(CaneHead { face: self .layout .drawing() diff --git a/src/router/tracer.rs b/src/router/tracer.rs index 6351a76..4cb1dbb 100644 --- a/src/router/tracer.rs +++ b/src/router/tracer.rs @@ -83,7 +83,7 @@ impl<'a, R: AccessRules> Tracer<'a, R> { let length = trace.path.len(); self.undo_path(trace, length - prefix_length); - Ok::<(), TracerException>(self.path(navmesh, trace, &path[prefix_length..], width)?) + self.path(navmesh, trace, &path[prefix_length..], width) } #[debug_ensures(ret.is_ok() -> trace.path.len() == old(trace.path.len() + path.len()))] diff --git a/vendored/contracts/src/implementation/codegen.rs b/vendored/contracts/src/implementation/codegen.rs index 0e7090a..b19d578 100644 --- a/vendored/contracts/src/implementation/codegen.rs +++ b/vendored/contracts/src/implementation/codegen.rs @@ -345,7 +345,10 @@ pub(crate) fn generate( syn::visit::visit_block(&mut try_detector, &mut block); if try_detector.found_try { - break 'blk quote::quote! { let ret: #return_type = 'run: { try { #block? } }; }; + break 'blk quote::quote! { let ret: #return_type = 'run: { try { + let ret2: #return_type = #block; + ret2? + } }; }; } else { break 'blk quote::quote! { let ret: #return_type = 'run: #block; }; }