Skip to content

Commit

Permalink
Merge pull request #204 from bgilbert/workflow
Browse files Browse the repository at this point in the history
workflows: bump toolchains; restrict repository access; fix build/lint warnings
  • Loading branch information
cgwalters authored Aug 2, 2021
2 parents 5e62ab1 + 777adf1 commit d901c5f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
---
name: Rust

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
# Minimum supported Rust version (MSRV)
ACTION_MSRV_TOOLCHAIN: 1.43.0
ACTION_MSRV_TOOLCHAIN: 1.49.0
# Pinned toolchain for linting
ACTION_LINTS_TOOLCHAIN: 1.47.0
ACTION_LINTS_TOOLCHAIN: 1.53.0

jobs:
tests-stable:
Expand Down
2 changes: 1 addition & 1 deletion src/bootupd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub(crate) fn get_components() -> Components {
}

#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
insert_component(&mut components, Box::new(efi::EFI::default()));
insert_component(&mut components, Box::new(efi::Efi::default()));

// #[cfg(target_arch = "x86_64")]
// components.push(Box::new(bios::BIOS::new()));
Expand Down
6 changes: 3 additions & 3 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mod tests {
let d_argv = vec!["/usr/bin/bootupd".to_string(), "daemon".to_string()];
let cli = MultiCall::from_args(d_argv);
match cli {
MultiCall::Ctl(cmd) => panic!(cmd),
MultiCall::Ctl(cmd) => panic!("{:?}", cmd),
MultiCall::D(_) => {}
};
}
Expand All @@ -67,15 +67,15 @@ mod tests {
let cli = MultiCall::from_args(ctl_argv);
match cli {
MultiCall::Ctl(_) => {}
MultiCall::D(cmd) => panic!(cmd),
MultiCall::D(cmd) => panic!("{:?}", cmd),
};
}
{
let ctl_argv = vec!["/bin-mount/bootupctl".to_string(), "validate".to_string()];
let cli = MultiCall::from_args(ctl_argv);
match cli {
MultiCall::Ctl(_) => {}
MultiCall::D(cmd) => panic!(cmd),
MultiCall::D(cmd) => panic!("{:?}", cmd),
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use std::path::{Path, PathBuf};

use crate::model::*;

#[serde(rename_all = "kebab-case")]
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "kebab-case")]
pub(crate) enum ValidationResult {
Valid,
Errors(Vec<String>),
Expand Down Expand Up @@ -70,7 +70,7 @@ pub(crate) trait Component {
/// Given a component name, create an implementation.
pub(crate) fn new_from_name(name: &str) -> Result<Box<dyn Component>> {
let r: Box<dyn Component> = match name {
"EFI" => Box::new(crate::efi::EFI::default()),
"EFI" => Box::new(crate::efi::Efi::default()),
_ => anyhow::bail!("No component {}", name),
};
Ok(r)
Expand Down
6 changes: 3 additions & 3 deletions src/efi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ lazy_static! {
}

#[derive(Default)]
pub(crate) struct EFI {}
pub(crate) struct Efi {}

impl EFI {
impl Efi {
fn esp_path(&self) -> PathBuf {
Path::new(&*MOUNT_PATH).join("EFI")
}
Expand Down Expand Up @@ -83,7 +83,7 @@ impl EFI {
}
}

impl Component for EFI {
impl Component for Efi {
fn name(&self) -> &'static str {
"EFI"
}
Expand Down

0 comments on commit d901c5f

Please sign in to comment.