Merge pull request #7663 from penpot/niwinz-staging-update-rust

⬆️ Update rust to 1.91
This commit is contained in:
Andrey Antukh
2025-11-03 11:26:01 +01:00
committed by GitHub
7 changed files with 22 additions and 35 deletions

View File

@@ -149,18 +149,24 @@ FROM base AS setup-rust
ENV PATH=/opt/cargo/bin:$PATH \
RUSTUP_HOME=/opt/rustup \
CARGO_HOME=/opt/cargo \
RUSTUP_VERSION=1.27.1 \
RUST_VERSION=1.85.0 \
RUSTUP_VERSION=1.28.2 \
RUST_VERSION=1.91.0 \
EMSCRIPTEN_VERSION=4.0.6
WORKDIR /opt
RUN set -eux; \
# Same steps as in Rust official Docker image https://github.com/rust-lang/docker-rust/blob/9f287282d513a84cb7c7f38f197838f15d37b6a9/1.81.0/bookworm/Dockerfile
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='1cffbf51e63e634c746f741de50649bbbcbd9dbe1de363c9ecef64e278dba2b2' ;; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
'amd64') \
rustArch='x86_64-unknown-linux-gnu'; \
rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \
;; \
'arm64') \
rustArch='aarch64-unknown-linux-gnu'; \
rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \
;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
wget "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${rustArch}/rustup-init"; \

View File

@@ -300,7 +300,7 @@ impl Ord for BezierStart {
type BM<'a> = BTreeMap<BezierStart, Vec<(BezierSource, Bezier)>>;
fn init_bm(beziers: &[(BezierSource, Bezier)]) -> BM {
fn init_bm(beziers: &[(BezierSource, Bezier)]) -> BM<'_> {
let mut bm = BM::default();
for entry @ (source, bezier) in beziers.iter() {
let value = *entry;

View File

@@ -87,8 +87,8 @@ fn get_text_stroke_paints(
let shader = text_paint.shader();
let mut is_opaque = true;
if shader.is_some() {
is_opaque = shader.unwrap().is_opaque();
if let Some(shader) = shader {
is_opaque = shader.is_opaque();
}
if is_opaque && count_inner_strokes == 1 {

View File

@@ -573,7 +573,7 @@ impl Shape {
(added, removed)
}
pub fn fills(&self) -> std::slice::Iter<Fill> {
pub fn fills(&self) -> std::slice::Iter<'_, Fill> {
self.fills.iter()
}

View File

@@ -1,30 +1,16 @@
use super::Path;
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Default, Clone, PartialEq)]
pub struct Bool {
pub bool_type: BoolType,
pub path: Path,
}
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Default, Clone, Copy, PartialEq)]
pub enum BoolType {
#[default]
Union,
Difference,
Intersection,
Exclusion,
}
impl Default for Bool {
fn default() -> Self {
Bool {
bool_type: BoolType::Union,
path: Path::default(),
}
}
}
impl Default for BoolType {
fn default() -> Self {
Self::Union
}
}

View File

@@ -3,18 +3,13 @@ use skia_safe::{self as skia, image_filters, ImageFilter, Paint};
use super::Color;
use crate::render::filters::compose_filters;
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Default, Clone, Copy, PartialEq)]
pub enum ShadowStyle {
#[default]
Drop,
Inner,
}
impl Default for ShadowStyle {
fn default() -> Self {
Self::Drop
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Shadow {
pub color: Color,

View File

@@ -180,7 +180,7 @@ pub extern "C" fn set_shape_path_buffer() {
let buffer = get_path_upload_buffer();
let mut buffer = buffer.lock().unwrap();
let chunk_size = size_of::<RawSegmentData>();
if buffer.len() % chunk_size != 0 {
if !buffer.len().is_multiple_of(chunk_size) {
// FIXME
println!("Warning: buffer length is not a multiple of chunk size!");
}