Skip to content

Conversation

@stenlarsson
Copy link
Contributor

@stenlarsson stenlarsson commented Dec 14, 2025

Rationale for this change

The TrimOptions class is not available in GLib/Ruby, and it is used together with the utf8_trim compute function.

What changes are included in this PR?

This adds the TrimOptions class to GLib.

Are these changes tested?

Yes, with Ruby unit tests.

Are there any user-facing changes?

Yes, a new class.

@stenlarsson stenlarsson requested a review from kou as a code owner December 14, 2025 16:01
@github-actions
Copy link

⚠️ GitHub issue #48509 has been automatically assigned in GitHub to PR creator.

Comment on lines 7137 to 7144
{
const gchar *characters = g_value_get_string(value);
if (priv->characters) {
g_free(priv->characters);
}
priv->characters = g_strdup(characters);
options->characters = characters ? characters : "";
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simplify this?

Suggested change
{
const gchar *characters = g_value_get_string(value);
if (priv->characters) {
g_free(priv->characters);
}
priv->characters = g_strdup(characters);
options->characters = characters ? characters : "";
}
options->characters = g_value_get_string(value);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I don't know why I thought that was needed. I removed the whole private struct.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants