refactor(types/headers/string): Don't typedef a string type
This really does not add anything, and just using `const char*` directly keeps things more clear.
This commit is contained in:
parent
17fd954e46
commit
938e038075
|
@ -62,7 +62,7 @@ plugin_main ()
|
|||
handle_error ();
|
||||
|
||||
println ("Saying hi!");
|
||||
string_t hi;
|
||||
const char *hi;
|
||||
if (!one.hi (&hi, "Adam"))
|
||||
handle_error ();
|
||||
|
||||
|
|
|
@ -23,15 +23,8 @@
|
|||
#define TRIXY_STRING_H
|
||||
|
||||
/**
|
||||
* @brief This string type is allocated by rust, which means that you can't
|
||||
* just free it from c, but need to return it to rust to be freed.
|
||||
* @see the `string_free` method
|
||||
* @brief Frees a rust-allocated string.
|
||||
*/
|
||||
typedef const char *string_t;
|
||||
|
||||
/**
|
||||
* @brief The free function for rust stings
|
||||
*/
|
||||
extern int string_free (string_t string);
|
||||
extern int string_free (const char *string);
|
||||
|
||||
#endif // TRIXY_STRING_H
|
||||
|
|
Reference in New Issue