Skip to content

Commit fa2d8c3

Browse files
adetayloremilio
authored andcommitted
Formatting tweaks.
1 parent 32b6d8a commit fa2d8c3

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

Diff for: bindgen-tests/tests/parse_callbacks/item_discovery_callback/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ impl ParseCallbacks for ItemDiscovery {
1818
}
1919
}
2020

21-
fn test_item_discovery_callback(header: &str, expected: HashMap<DiscoveredItemId, DiscoveredItem>) {
21+
fn test_item_discovery_callback(
22+
header: &str,
23+
expected: HashMap<DiscoveredItemId, DiscoveredItem>,
24+
) {
2225
let discovery = ItemDiscovery::default();
2326
let info = Rc::clone(&discovery.0);
2427

@@ -31,7 +34,6 @@ fn test_item_discovery_callback(header: &str, expected: HashMap<DiscoveredItemId
3134
.generate()
3235
.expect("TODO: panic message");
3336

34-
3537
compare_item_caches(&info.borrow(), &expected);
3638
}
3739

@@ -104,7 +106,6 @@ fn test_item_discovery_callback_c() {
104106
"/tests/parse_callbacks/item_discovery_callback/header_item_discovery.h", expected);
105107
}
106108

107-
108109
#[test]
109110
fn test_item_discovery_callback_cpp() {
110111
let expected = ItemCache::from([

Diff for: bindgen/callbacks.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ pub enum DiscoveredItem {
238238

239239
/// Type to which this method belongs.
240240
parent: DiscoveredItemId,
241-
}
242-
// modules, etc.
241+
}, // modules, etc.
243242
}
244243

245244
/// Relevant information about a type to which new derive attributes will be added using

Diff for: bindgen/codegen/mod.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -2502,10 +2502,7 @@ impl CodeGenerator for CompInfo {
25022502
},
25032503
};
25042504

2505-
cb.new_item_found(
2506-
discovered_id,
2507-
discovered_item,
2508-
);
2505+
cb.new_item_found(discovered_id, discovered_item);
25092506
});
25102507

25112508
// The custom derives callback may return a list of derive attributes;
@@ -3071,10 +3068,15 @@ impl Method {
30713068

30723069
method_names.insert(name.clone());
30733070

3074-
ctx.options().for_each_callback(|cb| cb.new_item_found(id, DiscoveredItem::Method {
3075-
parent: parent_id,
3076-
final_name: name.clone(),
3077-
}));
3071+
ctx.options().for_each_callback(|cb| {
3072+
cb.new_item_found(
3073+
id,
3074+
DiscoveredItem::Method {
3075+
parent: parent_id,
3076+
final_name: name.clone(),
3077+
},
3078+
)
3079+
});
30783080

30793081
let mut function_name = function_item.canonical_name(ctx);
30803082
if times_seen > 0 {
@@ -4673,7 +4675,7 @@ impl CodeGenerator for Function {
46734675
id,
46744676
DiscoveredItem::Function {
46754677
final_name: canonical_name.to_string(),
4676-
}
4678+
},
46774679
);
46784680
});
46794681

0 commit comments

Comments
 (0)