Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support obfuscating cstr literals #58

Merged
merged 1 commit into from
Oct 5, 2024
Merged

Support obfuscating cstr literals #58

merged 1 commit into from
Oct 5, 2024

Conversation

CasualX
Copy link
Owner

@CasualX CasualX commented May 13, 2024

No description provided.

@CasualX CasualX mentioned this pull request May 13, 2024
Copy link

@PaulDance PaulDance left a comment

Choose a reason for hiding this comment

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

The rest looks good, though! Maybe a test somewhere? Also, adding to the existing examples?

Comment on lines +203 to +206
pub const fn unsafe_as_str(bytes: &[u8]) -> &str {
// When used correctly by this crate's macros this should be safe
#[cfg(debug_assertions)]
return str::from_utf8(bytes).unwrap();
return match str::from_utf8(bytes) { Ok(s) => s, Err(_) => panic!("invalid str") };

Choose a reason for hiding this comment

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

Just passing by, even if this is only internal: the const part should not be required in both cases anymore, right?

@PaulDance
Copy link

Any chance to merge and release this some time soon?

@CasualX
Copy link
Owner Author

CasualX commented Oct 4, 2024

I haven't been very active sorry, I'll finish it this weekend.

@CasualX CasualX merged commit 3924cd2 into master Oct 5, 2024
3 checks passed
@CasualX CasualX deleted the cstr branch October 5, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants