ruby: tags: return string array directly

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras 2023-03-22 17:43:45 -06:00 committed by David Bremner
parent ae1336dea5
commit 3a52290609

View file

@ -23,7 +23,13 @@
VALUE VALUE
notmuch_rb_tags_get (notmuch_tags_t *tags) notmuch_rb_tags_get (notmuch_tags_t *tags)
{ {
return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, &notmuch_rb_tags_type, tags); VALUE rb_array = rb_ary_new ();
for (; notmuch_tags_valid (tags); notmuch_tags_move_to_next (tags)) {
const char *tag = notmuch_tags_get (tags);
rb_ary_push (rb_array, rb_str_new2 (tag));
}
return rb_array;
} }
/* /*