From a154e45cce79b0c2264c1e1cd37a3d1bf5bc6154 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 5 Jan 2023 17:29:14 -0500 Subject: Rust API: Lots and lots of clippy changes --- rust/src/flowgraph.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'rust/src/flowgraph.rs') diff --git a/rust/src/flowgraph.rs b/rust/src/flowgraph.rs index c4bf5340..92b098cd 100644 --- a/rust/src/flowgraph.rs +++ b/rust/src/flowgraph.rs @@ -33,9 +33,9 @@ pub struct EdgeStyle(pub(crate) BNEdgeStyle); impl EdgeStyle { pub fn new(style: EdgePenStyle, width: usize, color: ThemeColor) -> Self { EdgeStyle(BNEdgeStyle { - style: style, - width: width, - color: color, + style, + width, + color, }) } } @@ -65,12 +65,12 @@ impl<'a> FlowGraphNode<'a> { } pub fn new(graph: &FlowGraph) -> Self { - unsafe { FlowGraphNode::from_raw(BNCreateFlowGraphNode(graph.as_ref().handle)) } + unsafe { FlowGraphNode::from_raw(BNCreateFlowGraphNode(graph.handle)) } } pub fn set_disassembly_lines(&self, lines: &'a Vec) { unsafe { - BNSetFlowGraphNodeLines(self.as_ref().handle, lines.as_ptr() as *mut _, lines.len()); + BNSetFlowGraphNodeLines(self.handle, lines.as_ptr() as *mut _, lines.len()); // BNFreeDisassemblyTextLines(lines.as_ptr() as *mut _, lines.len()); // Shouldn't need...would be a double free? } } @@ -91,9 +91,9 @@ impl<'a> FlowGraphNode<'a> { ) { unsafe { BNAddFlowGraphNodeOutgoingEdge( - self.as_ref().handle, + self.handle, type_, - target.as_ref().handle, + target.handle, edge_style.0, ) } @@ -144,15 +144,15 @@ impl FlowGraph { } pub fn append(&self, node: &FlowGraphNode) -> usize { - unsafe { BNAddFlowGraphNode(self.as_ref().handle, node.handle) } + unsafe { BNAddFlowGraphNode(self.handle, node.handle) } } pub fn set_option(&self, option: FlowGraphOption, value: bool) { - unsafe { BNSetFlowGraphOption(self.as_ref().handle, option, value) } + unsafe { BNSetFlowGraphOption(self.handle, option, value) } } pub fn is_option_set(&self, option: FlowGraphOption) -> bool { - unsafe { BNIsFlowGraphOptionSet(self.as_ref().handle, option) } + unsafe { BNIsFlowGraphOptionSet(self.handle, option) } } } -- cgit v1.3.1