From 4583936f0b3b54aed93676d7a47e83245252cf48 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sat, 20 Oct 2018 17:02:52 +0200 Subject: [PATCH] Remove some temporary variables --- .../second-edition/posts/08-hardware-interrupts/index.md | 8 ++++---- src/interrupts.rs | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/blog/content/second-edition/posts/08-hardware-interrupts/index.md b/blog/content/second-edition/posts/08-hardware-interrupts/index.md index 61c8a285..485bb6bc 100644 --- a/blog/content/second-edition/posts/08-hardware-interrupts/index.md +++ b/blog/content/second-edition/posts/08-hardware-interrupts/index.md @@ -183,8 +183,8 @@ lazy_static! { let mut idt = InterruptDescriptorTable::new(); idt.breakpoint.set_handler_fn(breakpoint_handler); […] - let timer_interrupt_id = usize::from(TIMER_INTERRUPT_ID); // new - idt[timer_interrupt_id].set_handler_fn(timer_interrupt_handler); // new + idt[usize::from(TIMER_INTERRUPT_ID)] + .set_handler_fn(timer_interrupt_handler); // new idt }; @@ -432,8 +432,8 @@ lazy_static! { idt.breakpoint.set_handler_fn(breakpoint_handler); […] // new - let keyboard_interrupt_id = usize::from(KEYBOARD_INTERRUPT_ID); - idt[keyboard_interrupt_id].set_handler_fn(keyboard_interrupt_handler); + idt[usize::from(KEYBOARD_INTERRUPT_ID)] + .set_handler_fn(keyboard_interrupt_handler); idt }; diff --git a/src/interrupts.rs b/src/interrupts.rs index ce0898f3..fac6fc52 100644 --- a/src/interrupts.rs +++ b/src/interrupts.rs @@ -23,10 +23,8 @@ lazy_static! { .set_stack_index(gdt::DOUBLE_FAULT_IST_INDEX); } - let timer_interrupt_id = usize::from(TIMER_INTERRUPT_ID); - idt[timer_interrupt_id].set_handler_fn(timer_interrupt_handler); - let keyboard_interrupt_id = usize::from(KEYBOARD_INTERRUPT_ID); - idt[keyboard_interrupt_id].set_handler_fn(keyboard_interrupt_handler); + idt[usize::from(TIMER_INTERRUPT_ID)].set_handler_fn(timer_interrupt_handler); + idt[usize::from(KEYBOARD_INTERRUPT_ID)].set_handler_fn(keyboard_interrupt_handler); idt };