From b6b6e3692404e32873892810bebeb1122f34c52e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 25 May 2022 21:23:12 +0200 Subject: [PATCH] Replace static with const in two places --- src/font.rs | 2 +- src/library/utility/string.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/font.rs b/src/font.rs index 34ce63897..108ade107 100644 --- a/src/font.rs +++ b/src/font.rs @@ -259,7 +259,7 @@ impl Face { // - The slices's location is stable in memory: // - We don't move the underlying vector // - Nobody else can move it since we have a strong ref to the `Arc`. - // - The internal static lifetime is not leaked because its rewritten + // - The internal 'static lifetime is not leaked because its rewritten // to the self-lifetime in `ttf()`. let slice: &'static [u8] = unsafe { std::slice::from_raw_parts(buffer.as_ptr(), buffer.len()) }; diff --git a/src/library/utility/string.rs b/src/library/utility/string.rs index 2f80a5cba..3036df062 100644 --- a/src/library/utility/string.rs +++ b/src/library/utility/string.rs @@ -116,7 +116,7 @@ impl Numbering { } } -static ROMANS: &'static [(&'static str, usize)] = &[ +const ROMANS: &[(&str, usize)] = &[ ("M̅", 1000000), ("D̅", 500000), ("C̅", 100000), @@ -139,4 +139,4 @@ static ROMANS: &'static [(&'static str, usize)] = &[ ("I", 1), ]; -static SYMBOLS: &'static [char] = &['*', '†', '‡', '§', '‖', '¶']; +const SYMBOLS: &[char] = &['*', '†', '‡', '§', '‖', '¶'];