Address comments

This commit is contained in:
Noa committed 2025-03-25 21:06:56 -05:00
1 parent bd55baefa6
commit f3b8d5515a
5 files changed
+5 -11

No files matched your search

-1
View File
@@ -230,7 +230,6 @@ pub mod utf8 {
}
pub mod latin_1 {
use super::*;
pub const ENCODING_NAME: &str = "latin-1";
+1 -1
View File
@@ -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.
+3 -2
View File
@@ -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() {
@@ -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() {
+1 -5
View File
@@ -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"
-2
View File
@@ -1,4 +1,3 @@
#[cfg(feature = "wtf8")]
use rustpython_common::wtf8::Wtf8;
#[derive(Debug, Clone, Copy)]
@@ -151,7 +150,6 @@ impl StrDrive for &str {
}
}
#[cfg(feature = "wtf8")]
impl StrDrive for &Wtf8 {
#[inline]
fn count(&self) -> usize {