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:
Benedikt Peetz 2024-03-24 17:59:19 +01:00
parent 17fd954e46
commit 938e038075
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
2 changed files with 3 additions and 10 deletions

View File

@ -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 ();

View File

@ -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