aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/renderer
diff options
context:
space:
mode:
authorAyose <ayosec@gmail.com>2024-07-29 00:00:00 +0000
committerAyose <ayosec@gmail.com>2024-07-29 00:00:00 +0000
commit23c1b2fbcfdc84df806163ea26c5284e598cba2b (patch)
tree9cb0c2c362105007efc6866bf1100f3e72831f94 /alacritty/src/renderer
parent6c4910fd20c7bab08b3bcee00eed4b5e4b37ef08 (diff)
parentd021a7b6f871f4078073848cf8744881561eb254 (diff)
downloadr-alacritty-23c1b2fbcfdc84df806163ea26c5284e598cba2b.tar.gz
r-alacritty-23c1b2fbcfdc84df806163ea26c5284e598cba2b.tar.bz2
r-alacritty-23c1b2fbcfdc84df806163ea26c5284e598cba2b.zip
Merge remote-tracking branch 'vendor/master' into graphics
Diffstat (limited to 'alacritty/src/renderer')
-rw-r--r--alacritty/src/renderer/mod.rs8
-rw-r--r--alacritty/src/renderer/platform.rs2
-rw-r--r--alacritty/src/renderer/shader.rs6
-rw-r--r--alacritty/src/renderer/text/glyph_cache.rs13
4 files changed, 12 insertions, 17 deletions
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs
index 165e28ec..a1ffb311 100644
--- a/alacritty/src/renderer/mod.rs
+++ b/alacritty/src/renderer/mod.rs
@@ -69,10 +69,10 @@ impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::Shader(err) => {
- write!(f, "There was an error initializing the shaders: {}", err)
+ write!(f, "There was an error initializing the shaders: {err}")
},
Error::Other(err) => {
- write!(f, "{}", err)
+ write!(f, "{err}")
},
}
}
@@ -115,9 +115,9 @@ fn gl_get_string(
Ok(CStr::from_ptr(string_ptr as *const _).to_string_lossy())
},
gl::INVALID_ENUM => {
- Err(format!("OpenGL error requesting {}: invalid enum", description).into())
+ Err(format!("OpenGL error requesting {description}: invalid enum").into())
},
- error_id => Err(format!("OpenGL error {} requesting {}", error_id, description).into()),
+ error_id => Err(format!("OpenGL error {error_id} requesting {description}").into()),
}
}
}
diff --git a/alacritty/src/renderer/platform.rs b/alacritty/src/renderer/platform.rs
index 3568bd20..87ed29c2 100644
--- a/alacritty/src/renderer/platform.rs
+++ b/alacritty/src/renderer/platform.rs
@@ -12,10 +12,10 @@ use glutin::prelude::*;
use glutin::surface::{Surface, SurfaceAttributesBuilder, WindowSurface};
use log::{debug, LevelFilter};
-use raw_window_handle::{RawDisplayHandle, RawWindowHandle};
use winit::dpi::PhysicalSize;
#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
use winit::platform::x11;
+use winit::raw_window_handle::{RawDisplayHandle, RawWindowHandle};
/// Create the GL display.
pub fn create_gl_display(
diff --git a/alacritty/src/renderer/shader.rs b/alacritty/src/renderer/shader.rs
index e3baab9e..86938e45 100644
--- a/alacritty/src/renderer/shader.rs
+++ b/alacritty/src/renderer/shader.rs
@@ -196,9 +196,9 @@ impl std::error::Error for ShaderError {}
impl fmt::Display for ShaderError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
- Self::Compile(reason) => write!(f, "Failed compiling shader: {}", reason),
- Self::Link(reason) => write!(f, "Failed linking shader: {}", reason),
- Self::Uniform(name) => write!(f, "Failed to get uniform location of {:?}", name),
+ Self::Compile(reason) => write!(f, "Failed compiling shader: {reason}"),
+ Self::Link(reason) => write!(f, "Failed linking shader: {reason}"),
+ Self::Uniform(name) => write!(f, "Failed to get uniform location of {name:?}"),
}
}
}
diff --git a/alacritty/src/renderer/text/glyph_cache.rs b/alacritty/src/renderer/text/glyph_cache.rs
index 957cde1a..6acc3189 100644
--- a/alacritty/src/renderer/text/glyph_cache.rs
+++ b/alacritty/src/renderer/text/glyph_cache.rs
@@ -187,14 +187,9 @@ impl GlyphCache {
///
/// This will fail when the glyph could not be rasterized. Usually this is due to the glyph
/// not being present in any font.
- pub fn get<L: ?Sized>(
- &mut self,
- glyph_key: GlyphKey,
- loader: &mut L,
- show_missing: bool,
- ) -> Glyph
+ pub fn get<L>(&mut self, glyph_key: GlyphKey, loader: &mut L, show_missing: bool) -> Glyph
where
- L: LoadGlyph,
+ L: LoadGlyph + ?Sized,
{
// Try to load glyph from cache.
if let Some(glyph) = self.cache.get(&glyph_key) {
@@ -242,9 +237,9 @@ impl GlyphCache {
/// Load glyph into the atlas.
///
/// This will apply all transforms defined for the glyph cache to the rasterized glyph before
- pub fn load_glyph<L: ?Sized>(&self, loader: &mut L, mut glyph: RasterizedGlyph) -> Glyph
+ pub fn load_glyph<L>(&self, loader: &mut L, mut glyph: RasterizedGlyph) -> Glyph
where
- L: LoadGlyph,
+ L: LoadGlyph + ?Sized,
{
glyph.left += i32::from(self.glyph_offset.x);
glyph.top += i32::from(self.glyph_offset.y);