diff options
| author | KyleMiles <krm504@nyu.edu> | 2023-01-05 17:29:14 -0500 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2023-01-06 16:29:58 -0500 |
| commit | a154e45cce79b0c2264c1e1cd37a3d1bf5bc6154 (patch) | |
| tree | 11f436b720edfdf37819e9e83e7131d220687074 /rust/src/flowgraph.rs | |
| parent | 52edc39a7081fd6662e14fbcd473adabbbc36c7a (diff) | |
Rust API: Lots and lots of clippy changes
Diffstat (limited to 'rust/src/flowgraph.rs')
| -rw-r--r-- | rust/src/flowgraph.rs | 20 |
1 files changed, 10 insertions, 10 deletions
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<DisassemblyTextLine>) { 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) } } } |
