Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 6bbbb0fb rédigé par Kubat's avatar Kubat
Parcourir les fichiers

MISC: Reduce mut things in amadeus


Signed-off-by: default avatarKubat <mael.martin31@gmail.com>
parent c0f277e1
Branches
Aucune étiquette associée trouvée
1 requête de fusion!193AMADEUS: Implementation of lkt-lib
Pipeline #3226 en échec
...@@ -74,9 +74,10 @@ impl Card<'_, Kara> for KaraCard { ...@@ -74,9 +74,10 @@ impl Card<'_, Kara> for KaraCard {
const BOTTOM_SPACE: Option<f32> = Some(constants::BOTTOM_PANEL_MAX_SIZE); const BOTTOM_SPACE: Option<f32> = Some(constants::BOTTOM_PANEL_MAX_SIZE);
fn new(inner: Kara) -> Self { fn new(inner: Kara) -> Self {
let mut actions = Vec::new(); Self {
actions.reserve(5); inner,
Self { inner, actions } actions: Vec::with_capacity(5),
}
} }
fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &[action::Action]) { fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &[action::Action]) {
...@@ -183,9 +184,10 @@ impl Card<'_, Playlist> for PlaylistCard { ...@@ -183,9 +184,10 @@ impl Card<'_, Playlist> for PlaylistCard {
const BOTTOM_SPACE: Option<f32> = None; const BOTTOM_SPACE: Option<f32> = None;
fn new(inner: Playlist) -> Self { fn new(inner: Playlist) -> Self {
let mut actions = Vec::new(); Self {
actions.reserve(5); inner,
Self { inner, actions } actions: Vec::with_capacity(5),
}
} }
fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &[action::Action]) { fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &[action::Action]) {
......
...@@ -10,10 +10,10 @@ mod widgets; ...@@ -10,10 +10,10 @@ mod widgets;
use eframe::egui::Vec2; use eframe::egui::Vec2;
fn main() { fn main() {
logger::set_level(log::Level::Debug);
if let Err(e) = logger::init() { if let Err(e) = logger::init() {
panic!("Failed to install logger: {e}") panic!("Failed to install logger: {e}")
} }
logger::set_level(log::Level::Debug);
eframe::run_native( eframe::run_native(
"amadeus-rs", "amadeus-rs",
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter