Skip to content

Commit

Permalink
[Code Structure] Fix latest nightly rustc build (rust-lang/rust#115010)
Browse files Browse the repository at this point in the history
  • Loading branch information
sisungo committed Aug 30, 2023
1 parent e8d01d4 commit ccf7a0a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion airupd/src/storage/milestones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ impl Default for Milestones {
fn default() -> Self {
Self::new()
}
}
}
2 changes: 1 addition & 1 deletion airupd/src/storage/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ impl Default for Services {
fn default() -> Self {
Self::new()
}
}
}
5 changes: 1 addition & 4 deletions airupd/src/supervisor/app_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ impl AirupdExt for crate::app::Airupd {
}
}

async fn interrupt_service_task(
&self,
name: &str,
) -> Result<Arc<dyn TaskHandle>, Error> {
async fn interrupt_service_task(&self, name: &str) -> Result<Arc<dyn TaskHandle>, Error> {
let name = name.strip_suffix(Service::SUFFIX).unwrap_or(name);
match self.supervisors.get(name) {
Some(supervisor) => Ok(supervisor.interrupt_task().await?),
Expand Down
3 changes: 2 additions & 1 deletion airupd/src/supervisor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ impl Supervisor {
.ok();
}
Request::GetTaskHandle(chan) => {
chan.send(self.current_task.0.clone().ok_or(Error::TaskNotFound)).ok();
chan.send(self.current_task.0.clone().ok_or(Error::TaskNotFound))
.ok();
}
Request::InterruptTask(chan) => {
let handle = self.current_task.0.clone().ok_or(Error::TaskNotFound);
Expand Down
6 changes: 3 additions & 3 deletions airupfx/src/files/milestone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub struct Milestone {
pub base_chain: DirChain,
}
impl Milestone {
pub const EXTENSION: &str = "airm";
pub const SUFFIX: &str = ".airm";
pub const EXTENSION: &'static str = "airm";
pub const SUFFIX: &'static str = ".airm";

/// Reads a [Milestone] from given directory.
pub async fn read_from<P: AsRef<Path>>(path: P) -> Result<Self, ReadError> {
Expand Down Expand Up @@ -92,7 +92,7 @@ pub struct Manifest {
pub milestone: Metadata,
}
impl Manifest {
pub const FILE_NAME: &str = "milestone.airc";
pub const FILE_NAME: &'static str = "milestone.airc";

async fn read_from<P: AsRef<Path>>(path: P) -> Result<Self, ReadError> {
Ok(toml::from_str(&tokio::fs::read_to_string(path).await?)?)
Expand Down
4 changes: 2 additions & 2 deletions airupfx/src/files/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub struct Service {
pub env: Env,
}
impl Service {
pub const EXTENSION: &str = "airs";
pub const SUFFIX: &str = ".airs";
pub const EXTENSION: &'static str = "airs";
pub const SUFFIX: &'static str = ".airs";

/// Reads a [Service] from given path.
pub async fn read_from<P: AsRef<Path>>(path: P) -> Result<Self, ReadError> {
Expand Down
6 changes: 3 additions & 3 deletions airupfx/src/policy/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use strum::{EnumIter, IntoEnumIterator};
#[derive(Debug, Clone, Default)]
pub struct Policy(pub Vec<Item>);
impl Policy {
pub const EXTENSION: &str = "airp";
pub const SUFFIX: &str = ".airp";
pub const EXTENSION: &'static str = "airp";
pub const SUFFIX: &'static str = ".airp";

/// Creates a new [Policy] with presets.
pub fn with_preset() -> Self {
Expand Down Expand Up @@ -131,7 +131,7 @@ pub enum Action {
ManageServices,
}
impl Action {
const STRING_MAP: &[(Self, &'static str)] = &[
const STRING_MAP: &'static [(Self, &'static str)] = &[
(Self::Dump, "dump"),
(Self::Power, "power"),
(Self::SideloadServices, "sideload_services"),
Expand Down

0 comments on commit ccf7a0a

Please sign in to comment.