From 09d4ed34cf0cfc7566586c4d31aa7bcf14e13fb1 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 3 Jul 2024 11:12:21 +0800 Subject: [PATCH] Use Rust 1.77 C-string literals --- Cargo.toml | 1 + fontconfig-sys/Cargo.toml | 7 +-- fontconfig-sys/src/lib.rs | 118 +++++++++++++++++++------------------- fontconfig/Cargo.toml | 6 +- 4 files changed, 65 insertions(+), 67 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f6261a3..a73c9ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "fontconfig-sys", "fontconfig" diff --git a/fontconfig-sys/Cargo.toml b/fontconfig-sys/Cargo.toml index 9af3cac..2484b40 100644 --- a/fontconfig-sys/Cargo.toml +++ b/fontconfig-sys/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "yeslogic-fontconfig-sys" -version = "5.0.0" -edition = "2018" -rust-version = "1.64" +version = "6.0.0" +edition = "2021" +rust-version = "1.77" authors = [ "Austin Bonander ", "The Servo Project Developers", @@ -24,7 +24,6 @@ links = "fontconfig" name = "fontconfig_sys" [dependencies] -cstr = "0.2.11" dlib = "0.5.0" # This can't be optional because build.rs can't conditionally enable an # optional dependency: diff --git a/fontconfig-sys/src/lib.rs b/fontconfig-sys/src/lib.rs index 0740825..4812ae3 100644 --- a/fontconfig-sys/src/lib.rs +++ b/fontconfig-sys/src/lib.rs @@ -52,8 +52,6 @@ pub type FcType = enum__FcType; pub mod constants { use std::ffi::CStr; - use cstr::cstr; - use super::c_int; pub const FC_WEIGHT_THIN: c_int = 0; @@ -114,64 +112,64 @@ pub mod constants { pub const FC_CHARSET_DONE: u32 = u32::MAX; pub const FC_UTF8_MAX_LEN: c_int = 6; - pub const FC_FAMILY: &CStr = cstr!("family"); - pub const FC_STYLE: &CStr = cstr!("style"); - pub const FC_SLANT: &CStr = cstr!("slant"); - pub const FC_WEIGHT: &CStr = cstr!("weight"); - pub const FC_SIZE: &CStr = cstr!("size"); - pub const FC_ASPECT: &CStr = cstr!("aspect"); - pub const FC_PIXEL_SIZE: &CStr = cstr!("pixelsize"); - pub const FC_SPACING: &CStr = cstr!("spacing"); - pub const FC_FOUNDRY: &CStr = cstr!("foundry"); - pub const FC_ANTIALIAS: &CStr = cstr!("antialias"); - pub const FC_HINTING: &CStr = cstr!("hinting"); - pub const FC_HINT_STYLE: &CStr = cstr!("hintstyle"); - pub const FC_VERTICAL_LAYOUT: &CStr = cstr!("verticallayout"); - pub const FC_AUTOHINT: &CStr = cstr!("autohint"); - pub const FC_GLOBAL_ADVANCE: &CStr = cstr!("globaladvance"); - pub const FC_WIDTH: &CStr = cstr!("width"); - pub const FC_FILE: &CStr = cstr!("file"); - pub const FC_INDEX: &CStr = cstr!("index"); - pub const FC_FT_FACE: &CStr = cstr!("ftface"); - pub const FC_RASTERIZER: &CStr = cstr!("rasterizer"); - pub const FC_OUTLINE: &CStr = cstr!("outline"); - pub const FC_SCALABLE: &CStr = cstr!("scalable"); - pub const FC_COLOR: &CStr = cstr!("color"); - pub const FC_VARIABLE: &CStr = cstr!("variable"); - pub const FC_SCALE: &CStr = cstr!("scale"); - pub const FC_SYMBOL: &CStr = cstr!("symbol"); - pub const FC_DPI: &CStr = cstr!("dpi"); - pub const FC_RGBA: &CStr = cstr!("rgba"); - pub const FC_MINSPACE: &CStr = cstr!("minspace"); - pub const FC_SOURCE: &CStr = cstr!("source"); - pub const FC_CHARSET: &CStr = cstr!("charset"); - pub const FC_LANG: &CStr = cstr!("lang"); - pub const FC_FONTVERSION: &CStr = cstr!("fontversion"); - pub const FC_FULLNAME: &CStr = cstr!("fullname"); - pub const FC_FAMILYLANG: &CStr = cstr!("familylang"); - pub const FC_STYLELANG: &CStr = cstr!("stylelang"); - pub const FC_FULLNAMELANG: &CStr = cstr!("fullnamelang"); - pub const FC_CAPABILITY: &CStr = cstr!("capability"); - pub const FC_FONTFORMAT: &CStr = cstr!("fontformat"); - pub const FC_EMBOLDEN: &CStr = cstr!("embolden"); - pub const FC_EMBEDDED_BITMAP: &CStr = cstr!("embeddedbitmap"); - pub const FC_DECORATIVE: &CStr = cstr!("decorative"); - pub const FC_LCD_FILTER: &CStr = cstr!("lcdfilter"); - pub const FC_FONT_FEATURES: &CStr = cstr!("fontfeatures"); - pub const FC_FONT_VARIATIONS: &CStr = cstr!("fontvariations"); - pub const FC_NAMELANG: &CStr = cstr!("namelang"); - pub const FC_PRGNAME: &CStr = cstr!("prgname"); - pub const FC_HASH: &CStr = cstr!("hash"); - pub const FC_POSTSCRIPT_NAME: &CStr = cstr!("postscriptname"); - pub const FC_FONT_HAS_HINT: &CStr = cstr!("fonthashint"); - pub const FC_CACHE_SUFFIX: &CStr = cstr!(".cache-"); - pub const FC_DIR_CACHE_FILE: &CStr = cstr!("fonts.cache-"); - pub const FC_USER_CACHE_FILE: &CStr = cstr!(".fonts.cache-"); - pub const FC_CHARWIDTH: &CStr = cstr!("charwidth"); - pub const FC_CHAR_WIDTH: &CStr = cstr!("charwidth"); - pub const FC_CHAR_HEIGHT: &CStr = cstr!("charheight"); - pub const FC_MATRIX: &CStr = cstr!("matrix"); - pub const FC_ORDER: &CStr = cstr!("order"); + pub const FC_FAMILY: &CStr = c"family"; + pub const FC_STYLE: &CStr = c"style"; + pub const FC_SLANT: &CStr = c"slant"; + pub const FC_WEIGHT: &CStr = c"weight"; + pub const FC_SIZE: &CStr = c"size"; + pub const FC_ASPECT: &CStr = c"aspect"; + pub const FC_PIXEL_SIZE: &CStr = c"pixelsize"; + pub const FC_SPACING: &CStr = c"spacing"; + pub const FC_FOUNDRY: &CStr = c"foundry"; + pub const FC_ANTIALIAS: &CStr = c"antialias"; + pub const FC_HINTING: &CStr = c"hinting"; + pub const FC_HINT_STYLE: &CStr = c"hintstyle"; + pub const FC_VERTICAL_LAYOUT: &CStr = c"verticallayout"; + pub const FC_AUTOHINT: &CStr = c"autohint"; + pub const FC_GLOBAL_ADVANCE: &CStr = c"globaladvance"; + pub const FC_WIDTH: &CStr = c"width"; + pub const FC_FILE: &CStr = c"file"; + pub const FC_INDEX: &CStr = c"index"; + pub const FC_FT_FACE: &CStr = c"ftface"; + pub const FC_RASTERIZER: &CStr = c"rasterizer"; + pub const FC_OUTLINE: &CStr = c"outline"; + pub const FC_SCALABLE: &CStr = c"scalable"; + pub const FC_COLOR: &CStr = c"color"; + pub const FC_VARIABLE: &CStr = c"variable"; + pub const FC_SCALE: &CStr = c"scale"; + pub const FC_SYMBOL: &CStr = c"symbol"; + pub const FC_DPI: &CStr = c"dpi"; + pub const FC_RGBA: &CStr = c"rgba"; + pub const FC_MINSPACE: &CStr = c"minspace"; + pub const FC_SOURCE: &CStr = c"source"; + pub const FC_CHARSET: &CStr = c"charset"; + pub const FC_LANG: &CStr = c"lang"; + pub const FC_FONTVERSION: &CStr = c"fontversion"; + pub const FC_FULLNAME: &CStr = c"fullname"; + pub const FC_FAMILYLANG: &CStr = c"familylang"; + pub const FC_STYLELANG: &CStr = c"stylelang"; + pub const FC_FULLNAMELANG: &CStr = c"fullnamelang"; + pub const FC_CAPABILITY: &CStr = c"capability"; + pub const FC_FONTFORMAT: &CStr = c"fontformat"; + pub const FC_EMBOLDEN: &CStr = c"embolden"; + pub const FC_EMBEDDED_BITMAP: &CStr = c"embeddedbitmap"; + pub const FC_DECORATIVE: &CStr = c"decorative"; + pub const FC_LCD_FILTER: &CStr = c"lcdfilter"; + pub const FC_FONT_FEATURES: &CStr = c"fontfeatures"; + pub const FC_FONT_VARIATIONS: &CStr = c"fontvariations"; + pub const FC_NAMELANG: &CStr = c"namelang"; + pub const FC_PRGNAME: &CStr = c"prgname"; + pub const FC_HASH: &CStr = c"hash"; + pub const FC_POSTSCRIPT_NAME: &CStr = c"postscriptname"; + pub const FC_FONT_HAS_HINT: &CStr = c"fonthashint"; + pub const FC_CACHE_SUFFIX: &CStr = c".cache-"; + pub const FC_DIR_CACHE_FILE: &CStr = c"fonts.cache-"; + pub const FC_USER_CACHE_FILE: &CStr = c".fonts.cache-"; + pub const FC_CHARWIDTH: &CStr = c"charwidth"; + pub const FC_CHAR_WIDTH: &CStr = c"charwidth"; + pub const FC_CHAR_HEIGHT: &CStr = c"charheight"; + pub const FC_MATRIX: &CStr = c"matrix"; + pub const FC_ORDER: &CStr = c"order"; } #[repr(C)] diff --git a/fontconfig/Cargo.toml b/fontconfig/Cargo.toml index abc08e4..3713c52 100644 --- a/fontconfig/Cargo.toml +++ b/fontconfig/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "fontconfig" version = "0.8.0" -edition = "2018" -rust-version = "1.64" +edition = "2021" +rust-version = "1.77" authors = [ "Austin Bonander ", "Manuel Reinhardt ", @@ -19,7 +19,7 @@ documentation = "https://docs.rs/crate/fontconfig" repository = "https://github.com/yeslogic/fontconfig-rs" [dependencies.yeslogic-fontconfig-sys] -version = "5.0.0" +version = "6.0.0" path = "../fontconfig-sys" [features]