aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsodiboo <git@sodi.boo>2024-10-05 22:53:06 +0200
committerIvan Molodetskikh <yalterz@gmail.com>2024-10-05 22:26:47 -0700
commit9b78b15ba5aa376a192549486fbec2eb54a7c816 (patch)
tree34c1336fe44005a7636ba34e4e81cd1e22b6395a /src
parentb9fd0a405e1b15398c2f84e66ff5b2f47744d6bc (diff)
downloadniri-9b78b15ba5aa376a192549486fbec2eb54a7c816.tar.gz
niri-9b78b15ba5aa376a192549486fbec2eb54a7c816.tar.bz2
niri-9b78b15ba5aa376a192549486fbec2eb54a7c816.zip
use CStr literals over calling CStr::from_bytes_with_nul
Diffstat (limited to 'src')
-rw-r--r--src/render_helpers/shader_element.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/render_helpers/shader_element.rs b/src/render_helpers/shader_element.rs
index b3014d68..d48f4d71 100644
--- a/src/render_helpers/shader_element.rs
+++ b/src/render_helpers/shader_element.rs
@@ -1,5 +1,5 @@
use std::collections::HashMap;
-use std::ffi::{CStr, CString};
+use std::ffi::CString;
use std::rc::Rc;
use glam::{Mat3, Vec2};
@@ -76,14 +76,14 @@ unsafe fn compile_program(
let debug_program =
unsafe { link_program(gl, include_str!("shaders/texture.vert"), &debug_shader)? };
- let vert = CStr::from_bytes_with_nul(b"vert\0").expect("NULL terminated");
- let vert_position = CStr::from_bytes_with_nul(b"vert_position\0").expect("NULL terminated");
- let matrix = CStr::from_bytes_with_nul(b"matrix\0").expect("NULL terminated");
- let tex_matrix = CStr::from_bytes_with_nul(b"tex_matrix\0").expect("NULL terminated");
- let size = CStr::from_bytes_with_nul(b"niri_size\0").expect("NULL terminated");
- let scale = CStr::from_bytes_with_nul(b"niri_scale\0").expect("NULL terminated");
- let alpha = CStr::from_bytes_with_nul(b"niri_alpha\0").expect("NULL terminated");
- let tint = CStr::from_bytes_with_nul(b"niri_tint\0").expect("NULL terminated");
+ let vert = c"vert";
+ let vert_position = c"vert_position";
+ let matrix = c"matrix";
+ let tex_matrix = c"tex_matrix";
+ let size = c"niri_size";
+ let scale = c"niri_scale";
+ let alpha = c"niri_alpha";
+ let tint = c"niri_tint";
Ok(ShaderProgram(Rc::new(ShaderProgramInner {
normal: ShaderProgramInternal {