We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 276dc78 commit 425923bCopy full SHA for 425923b
1 file changed
src/fonts.rs
@@ -67,15 +67,15 @@ impl Pattern {
67
}
68
69
pub fn get_file_name(&self) -> &str {
70
- let name = b"file\0";
+ let name = CString::new("file").unwrap();
71
unsafe {
72
let mut file_name = ptr::null();
73
FcPatternGetString(self.pattern, name.as_ptr(), 0, &mut file_name);
74
CStr::from_ptr(file_name).to_str().unwrap()
75
76
77
pub fn get_font_index(&self) -> isize {
78
- let name = b"index\0";
+ let name = CString::new("index").unwrap();
79
80
let mut index = 0;
81
FcPatternGetInteger(self.pattern, name.as_ptr(), 0, &mut index);
0 commit comments