Skip to content

Commit e3919ef

Browse files
rbranemesare
authored andcommitted
fix Platform TypeParser related functions
1 parent 5239db6 commit e3919ef

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

rust/src/platform.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ impl Platform {
267267
source: &str,
268268
file_name: &str,
269269
include_dirs: &[BnString],
270-
) -> Result<BnString, Vec<TypeParserError>> {
270+
) -> Result<BnString, TypeParserError> {
271271
let source_cstr = BnString::new(source);
272272
let file_name_cstr = BnString::new(file_name);
273273

@@ -289,13 +289,13 @@ impl Platform {
289289
Ok(unsafe { BnString::from_raw(result) })
290290
} else {
291291
assert!(!error_string.is_null());
292-
Err(vec![TypeParserError::new(
292+
Err(TypeParserError::new(
293293
TypeParserErrorSeverity::FatalSeverity,
294294
unsafe { BnString::from_raw(error_string) },
295295
file_name,
296296
0,
297297
0,
298-
)])
298+
))
299299
}
300300
}
301301
pub fn parse_types_from_source(
@@ -304,7 +304,7 @@ impl Platform {
304304
filename: &str,
305305
include_dirs: &[BnString],
306306
auto_type_source: &str,
307-
) -> Result<TypeParserResult, Vec<TypeParserError>> {
307+
) -> Result<TypeParserResult, TypeParserError> {
308308
let source_cstr = BnString::new(src);
309309
let file_name_cstr = BnString::new(filename);
310310
let auto_type_source = BnString::new(auto_type_source);
@@ -328,13 +328,13 @@ impl Platform {
328328
Ok(unsafe { TypeParserResult::from_raw(result) })
329329
} else {
330330
assert!(!error_string.is_null());
331-
Err(vec![TypeParserError::new(
331+
Err(TypeParserError::new(
332332
TypeParserErrorSeverity::FatalSeverity,
333333
unsafe { BnString::from_raw(error_string) },
334334
filename,
335335
0,
336336
0,
337-
)])
337+
))
338338
}
339339
}
340340

@@ -343,7 +343,7 @@ impl Platform {
343343
filename: &str,
344344
include_dirs: &[BnString],
345345
auto_type_source: &str,
346-
) -> Result<TypeParserResult, Vec<TypeParserError>> {
346+
) -> Result<TypeParserResult, TypeParserError> {
347347
let file_name_cstr = BnString::new(filename);
348348
let auto_type_source = BnString::new(auto_type_source);
349349

@@ -365,13 +365,13 @@ impl Platform {
365365
Ok(unsafe { TypeParserResult::from_raw(result) })
366366
} else {
367367
assert!(!error_string.is_null());
368-
Err(vec![TypeParserError::new(
368+
Err(TypeParserError::new(
369369
TypeParserErrorSeverity::FatalSeverity,
370370
unsafe { BnString::from_raw(error_string) },
371371
filename,
372372
0,
373373
0,
374-
)])
374+
))
375375
}
376376
}
377377
}

rust/src/typeparser.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ impl CoreTypeParser {
7878
let mut result = ptr::null_mut();
7979
let mut errors = ptr::null_mut();
8080
let mut error_count = 0;
81-
// SAFETY BnString and *const ffi::c_char are transparent
8281
let success = unsafe {
8382
BNTypeParserPreprocessSource(
8483
self.as_raw(),
@@ -119,7 +118,6 @@ impl CoreTypeParser {
119118
let mut result = BNTypeParserResult::default();
120119
let mut errors = ptr::null_mut();
121120
let mut error_count = 0;
122-
// SAFETY BnString and *const ffi::c_char are transparent
123121
let success = unsafe {
124122
BNTypeParserParseTypesFromSource(
125123
self.as_raw(),

0 commit comments

Comments
 (0)