Skip to content

Commit

Permalink
~ clean
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Nov 3, 2024
1 parent 9e90c07 commit d2d0eed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/cmd/renc.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use eyre::{eyre, ContextCompat, Result};
use spdlog::{debug, error, info, trace};
use std::{collections::HashMap, fs, iter, path::PathBuf};
use spdlog::{error, info};
use std::{fs, path::PathBuf};

use crate::helper::stored::{SecMap, SumPath};
use crate::interop::add_to_store;
use crate::profile::{MasterIdentity, Profile};
use crate::{interop::add_to_store, profile};

use crate::helper::parse_identity::ParsedIdentity;
impl Profile {
Expand Down
18 changes: 3 additions & 15 deletions src/helper/parse_identity.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
use std::{fs, str::FromStr};

use crate::profile::MasterIdentity;
use age::{x25519, Identity, IdentityFile, Recipient};
use age::{Identity, IdentityFile, Recipient};
use eyre::{eyre, ContextCompat, Result};
use spdlog::{debug, error, info};

use super::callback::UiCallbacks;

#[allow(dead_code)]
pub struct ParsedIdentity {
identity: Box<dyn Identity>,
recipient: Box<dyn Recipient>,
}
impl ParsedIdentity {
// pub fn new<I, R>(identity: I, recipient: R) -> Self
// where
// I: Identity + 'static,
// R: Recipient + 'static,
// {
// Self {
// identity: Box::new(identity),
// recipient: Box::new(recipient),
// }
// }
pub fn from_exist(identity: Box<dyn Identity>, recipient: Box<dyn Recipient>) -> Self {
Self {
identity,
Expand All @@ -31,7 +19,7 @@ impl ParsedIdentity {
pub fn get_identity(&self) -> &Box<dyn Identity> {
&self.identity
}
pub fn get_recipient(&self) -> &Box<dyn Recipient> {
pub fn _get_recipient(&self) -> &Box<dyn Recipient> {
&self.recipient
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/interop/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
process::{Command, Output},
};

use eyre::{eyre, Context, Result};
use eyre::{eyre, Result};

pub fn add_to_store<P: AsRef<Path>>(p: P) -> Result<Output> {
Command::new("nix")
Expand Down
3 changes: 2 additions & 1 deletion src/profile.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use eyre::Result;
use std::collections::HashMap;

use serde::Deserialize;
Expand Down Expand Up @@ -29,6 +28,7 @@ pub struct Settings {
pub decrypted_dir: String,
pub decrypted_mount_point: String,
pub host_identifier: String,
#[allow(dead_code)]
pub extra_recipients: Vec<String>,
pub host_pubkey: String,
pub host_keys: Vec<HostKey>,
Expand All @@ -40,6 +40,7 @@ pub struct Settings {
#[derive(Debug, Deserialize)]
pub struct MasterIdentity {
pub identity: String,
#[allow(dead_code)]
pub pubkey: String,
}
#[derive(Debug, Deserialize)]
Expand Down

0 comments on commit d2d0eed

Please sign in to comment.