Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Allow surrogates in str #5587

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

Merged
merged 10 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address comments
  • Loading branch information
coolreader18 committed Mar 26, 2025
commit f3b8d5515a72884c4b01ec6adc3d6eb140fbabf8
1 change: 0 additions & 1 deletion 1 common/src/encodings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ pub mod utf8 {
}

pub mod latin_1 {

use super::*;

pub const ENCODING_NAME: &str = "latin-1";
Expand Down
2 changes: 1 addition & 1 deletion 2 common/src/wtf8/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! needing any copies or re-encoding.
//!
//! This implementation is mostly copied from the WTF-8 implentation in the
//! Rust standard library, which is used as the backing for [`OsStr`] on
//! Rust 1.85 standard library, which is used as the backing for [`OsStr`] on
//! Windows targets. As previously mentioned, however, it is modified to not
//! join two surrogates into one codepoint when concatenating strings, in order
//! to match CPython's behavior.
Expand Down
5 changes: 3 additions & 2 deletions 5 vm/src/anystr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,7 @@ pub trait AnyStr {

// Unified form of CPython functions:
// _Py_bytes_islower
// Py_bytes_isupper
// unicode_islower_impl
// unicode_isupper_impl
fn py_islower(&self) -> bool {
let mut lower = false;
for c in self.elements() {
Expand All @@ -418,6 +416,9 @@ pub trait AnyStr {
lower
}

// Unified form of CPython functions:
// Py_bytes_isupper
// unicode_isupper_impl
fn py_isupper(&self) -> bool {
let mut upper = false;
for c in self.elements() {
Expand Down
6 changes: 1 addition & 5 deletions 6 vm/sre_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ license.workspace = true
name = "benches"
harness = false

[features]
default = ["wtf8"]
wtf8 = ["rustpython-common"]

[dependencies]
rustpython-common = { workspace = true, optional = true }
rustpython-common = { workspace = true }
num_enum = { workspace = true }
bitflags = { workspace = true }
optional = "0.5"
Expand Down
2 changes: 0 additions & 2 deletions 2 vm/sre_engine/src/string.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[cfg(feature = "wtf8")]
use rustpython_common::wtf8::Wtf8;

#[derive(Debug, Clone, Copy)]
Expand Down Expand Up @@ -151,7 +150,6 @@ impl StrDrive for &str {
}
}

#[cfg(feature = "wtf8")]
impl StrDrive for &Wtf8 {
#[inline]
fn count(&self) -> usize {
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.