maint: fix warnings

This commit is contained in:
2025-07-19 09:47:20 +03:00
parent dd43135b64
commit 6b0d5def50
6 changed files with 13 additions and 14 deletions
+1
View File
@@ -1,3 +1,4 @@
#![allow(unused)]
#![no_std] #![no_std]
use bytemuck::{Pod, Zeroable}; use bytemuck::{Pod, Zeroable};
+1
View File
@@ -16,6 +16,7 @@ use crate::elf::types::{PT_LOAD, SHF_ALLOC, SHF_WRITE, SHT_PROGBITS};
use self::types::{Ehdr, Phdr, Shdr}; use self::types::{Ehdr, Phdr, Shdr};
#[allow(unused)]
mod types { mod types {
use bytemuck::{Pod, Zeroable}; use bytemuck::{Pod, Zeroable};
@@ -20,7 +20,7 @@ pub trait Transport: Send {
fn notify_cfg(&self) -> &[WriteOnly<u16>]; fn notify_cfg(&self) -> &[WriteOnly<u16>];
fn notify_off_mul(&self) -> usize; fn notify_off_mul(&self) -> usize;
fn supports_msix(&self) -> bool; fn supports_msix(&self) -> bool;
fn device_cfg(&self) -> Option<&DeviceMemoryIo<[u8]>>; fn device_cfg(&self) -> Option<&DeviceMemoryIo<'_, [u8]>>;
fn read_interrupt_status(&self) -> (bool, bool); fn read_interrupt_status(&self) -> (bool, bool);
fn read_device_features(&mut self) -> u64 { fn read_device_features(&mut self) -> u64 {
+1 -1
View File
@@ -525,7 +525,7 @@ impl State {
if vt_color == 9 { if vt_color == 9 {
self.attributes.bg = self.default_attributes.bg; self.attributes.bg = self.default_attributes.bg;
} else { } else {
self.attributes.bg = Color::from_escape(&*CONFIG, false, vt_color) self.attributes.bg = Color::from_escape(&CONFIG, false, vt_color)
.unwrap_or(self.default_attributes.bg); .unwrap_or(self.default_attributes.bg);
} }
} }
+2 -1
View File
@@ -15,7 +15,7 @@ pub struct AutoConnector {
pub enum AutoConnection { pub enum AutoConnection {
Tcp(TcpStream), Tcp(TcpStream),
Tls(TlsConnection), Tls(Box<TlsConnection>),
} }
impl AutoConnector { impl AutoConnector {
@@ -48,6 +48,7 @@ impl HttpConnector for AutoConnector {
"https" => self "https" => self
.tls .tls
.connect(remote, scheme, server_name, timeout, options) .connect(remote, scheme, server_name, timeout, options)
.map(Box::new)
.map(AutoConnection::Tls), .map(AutoConnection::Tls),
_ => unreachable!(), _ => unreachable!(),
} }
+7 -11
View File
@@ -141,20 +141,16 @@ fn run(mut input: ShellInput, env: &mut Environment) -> Result<(), Error> {
continue; continue;
} }
}; };
let old_termios = match &mut input { let old_termios = if let ShellInput::Interactive(interactive) = &mut input {
ShellInput::Interactive(interactive) => { let new = TerminalOptionsImpl::normal();
let new = TerminalOptionsImpl::normal(); Some(interactive.set_options(new)?)
Some(interactive.set_options(new)?) } else {
} None
_ => None,
}; };
let (outcome, exit) = command::eval::evaluate(&expr, env); let (outcome, exit) = command::eval::evaluate(&expr, env);
match &mut input { if let ShellInput::Interactive(interactive) = &mut input {
ShellInput::Interactive(interactive) => { interactive.set_options(old_termios.unwrap()).ok();
interactive.set_options(old_termios.unwrap()).ok();
}
_ => (),
} }
command_text.clear(); command_text.clear();