8000 Constify functions & General nitpicks by ShaharNaveh · Pull Request #5858 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content

Constify functions & General nitpicks #5858

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 13 commits into from
Jun 28, 2025
Prev Previous commit
Next Next commit
constify more
  • Loading branch information
ShaharNaveh committed Jun 28, 2025
commit 48ecb7faed8356f88c3a740c58dd6ece88be4b9b
6 changes: 3 additions & 3 deletions vm/src/bytes_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,17 +305,17 @@ impl PyBytesInner {
}

#[inline]
pub fn len(&self) -> usize {
pub const fn len(&self) -> usize {
self.elements.len()
}

#[inline]
pub fn capacity(&self) -> usize {
pub const fn capacity(&self) -> usize {
self.elements.capacity()
}

#[inline]
pub fn is_empty(&self) -> bool {
pub const fn is_empty(&self) -> bool {
self.elements.is_empty()
}

Expand Down
0