mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Address comments
This commit is contained in:
5 files changed
+5
-11
No files matched your search
@@ -230,7 +230,6 @@ pub mod utf8 {
|
||||
}
|
||||
|
||||
pub mod latin_1 {
|
||||
|
||||
use super::*;
|
||||
|
||||
pub const ENCODING_NAME: &str = "latin-1";
|
||||
|
||||
@@ -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
@@ -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() {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user