Browse Source

cargo fmt

master
Adrian Heine 3 days ago
parent
commit
ddf645e19e
  1. 8
      src/builder.rs
  2. 13
      src/locator.rs
  3. 4
      src/setup/util.rs
  4. 2
      src/symbols/user.rs

8
src/builder.rs

@ -1,9 +1,9 @@
use crate::command_runner::{SetuidCommandRunner, StdCommandRunner};
use crate::resources::{
AcmeAccountKey, AcmeChallengesDir, AcmeChallengesNginxSnippet, AcmeUser, Cert,
CertChain, Cron, Csr, DefaultServer, Dir, File, GitCheckout, Key, KeyAndCertBundle,
LoadedDirectory, MariaDbDatabase, MariaDbUser, NpmInstall, Owner, PhpFpmPool, PostgresqlDatabase,
Resource, ServeCustom, ServePhp, ServeRedir, ServeService, ServeStatic, StoredDirectory,
AcmeAccountKey, AcmeChallengesDir, AcmeChallengesNginxSnippet, AcmeUser, Cert, CertChain, Cron,
Csr, DefaultServer, Dir, File, GitCheckout, Key, KeyAndCertBundle, LoadedDirectory,
MariaDbDatabase, MariaDbUser, NpmInstall, Owner, PhpFpmPool, PostgresqlDatabase, Resource,
ServeCustom, ServePhp, ServeRedir, ServeService, ServeStatic, StoredDirectory,
SystemdSocketService, User, UserForDomain, WordpressPlugin, WordpressTranslation,
};
use crate::storage::SimpleStorage;

13
src/locator.rs

@ -3,10 +3,10 @@ use crate::artifacts::{
UserName as UserNameArtifact,
};
use crate::resources::{
AcmeAccountKey, AcmeChallengesDir, AcmeChallengesNginxSnippet, AcmeUser, Cert,
CertChain, Cron, Csr, DefaultServer, Dir, File, GitCheckout, Key, KeyAndCertBundle,
LoadedDirectory, MariaDbDatabase, MariaDbUser, NpmInstall, Owner, PhpFpmPool, PostgresqlDatabase,
Resource, ServeCustom, ServePhp, ServeRedir, ServeService, ServeStatic, StoredDirectory,
AcmeAccountKey, AcmeChallengesDir, AcmeChallengesNginxSnippet, AcmeUser, Cert, CertChain, Cron,
Csr, DefaultServer, Dir, File, GitCheckout, Key, KeyAndCertBundle, LoadedDirectory,
MariaDbDatabase, MariaDbUser, NpmInstall, Owner, PhpFpmPool, PostgresqlDatabase, Resource,
ServeCustom, ServePhp, ServeRedir, ServeService, ServeStatic, StoredDirectory,
SystemdSocketService, User, UserForDomain, WordpressPlugin, WordpressTranslation,
};
use crate::to_artifact::ToArtifact;
@ -198,7 +198,10 @@ impl<P: Policy> ResourceLocator<AcmeUser> for DefaultLocator<P> {
fn locate(_resource: &AcmeUser) -> (<AcmeUser as Resource>::Artifact, Self::Prerequisites) {
let user_name = P::acme_user();
let home = P::user_home(&user_name);
((UserNameArtifact(user_name.into()), PathArtifact::from(home)), ())
(
(UserNameArtifact(user_name.into()), PathArtifact::from(home)),
(),
)
}
}

4
src/setup/util.rs

@ -108,7 +108,9 @@ impl Recorder {
slog_term::CompactFormat::new(decorator).build(),
move |record| record.level().is_at_least(filter_level),
);
let Ok(mutex) = Arc::try_unwrap(self.0) else { panic!("cannot unwrap Arc") }; // AsyncRecord does not implement Debug, so we cannot unwrap
let Ok(mutex) = Arc::try_unwrap(self.0) else {
panic!("cannot unwrap Arc")
}; // AsyncRecord does not implement Debug, so we cannot unwrap
for record in mutex.into_inner().unwrap() {
record.log_to(&drain).unwrap();
}

2
src/symbols/user.rs

@ -3,8 +3,8 @@ use crate::symbols::Symbol;
use async_trait::async_trait;
use once_cell::sync::Lazy;
use std::error::Error;
use tokio::sync::Semaphore;
use std::path::Path;
use tokio::sync::Semaphore;
pub type Wait = Lazy<Semaphore>;
static WAIT: Wait = Lazy::new(|| Semaphore::new(1));

Loading…
Cancel
Save