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 ();
|
handle_error ();
|
||||||
|
|
||||||
println ("Saying hi!");
|
println ("Saying hi!");
|
||||||
string_t hi;
|
const char *hi;
|
||||||
if (!one.hi (&hi, "Adam"))
|
if (!one.hi (&hi, "Adam"))
|
||||||
handle_error ();
|
handle_error ();
|
||||||
|
|
||||||
|
|
|
@ -23,15 +23,8 @@
|
||||||
#define TRIXY_STRING_H
|
#define TRIXY_STRING_H
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This string type is allocated by rust, which means that you can't
|
* @brief Frees a rust-allocated string.
|
||||||
* just free it from c, but need to return it to rust to be freed.
|
|
||||||
* @see the `string_free` method
|
|
||||||
*/
|
*/
|
||||||
typedef const char *string_t;
|
extern int string_free (const char *string);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief The free function for rust stings
|
|
||||||
*/
|
|
||||||
extern int string_free (string_t string);
|
|
||||||
|
|
||||||
#endif // TRIXY_STRING_H
|
#endif // TRIXY_STRING_H
|
||||||
|
|
Reference in New Issue