Skip to content

Conversation

@BiagioFesta
Copy link
Contributor

Maybe I've missed something, but it was faster opening a one-line PR for seeking feedback.

In rust this is totally valid:

let bytes = b"1234";
let sub = &bytes[4..];

But this is not in glib at the moment:

let bytes = glib::Bytes::from_static(b"1234");
let sub = glib::Bytes::from_bytes(&bytes, 4..);  // This crashes without this patch

This patch does not contradict Bytes.new_from_bytes 'cause end + 0 <= len holds.

Copy link
Member

@sdroege sdroege left a comment

Choose a reason for hiding this comment

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

Thanks, this makes sense

@sdroege sdroege added the needs-backport PR needs backporting to the current stable branch label Nov 15, 2025
@sdroege sdroege merged commit 609a734 into gtk-rs:main Nov 15, 2025
42 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-backport PR needs backporting to the current stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants