Просмотр исходного кода

bin/darkirc: remove unused commented code

Dastan-glitch 3 лет назад
Родитель
Сommit
6df3b5d339
3 измененных файлов с 0 добавлено и 16 удалено
  1. 0 1
      bin/darkirc/src/irc/client.rs
  2. 0 2
      bin/darkirc/src/irc/mod.rs
  3. 0 13
      bin/darkirc/src/settings.rs

+ 0 - 1
bin/darkirc/src/irc/client.rs

@@ -119,7 +119,6 @@ impl<C: AsyncRead + AsyncWrite + Send + Unpin + 'static> IrcClient<C> {
 
         self.irc_config.channels.extend(new_config.channels);
         self.irc_config.contacts.extend(new_config.contacts);
-        // self.irc_config.private_key = new_config.private_key;
         self.irc_config.password = new_config.password;
 
         if self.on_receive_join(self.irc_config.channels.keys().cloned().collect()).await.is_err() {

+ 0 - 2
bin/darkirc/src/irc/mod.rs

@@ -46,7 +46,6 @@ pub struct IrcConfig {
     // user config
     pub nickname: String,
     pub password: String,
-    // pub private_key: Option<String>,
     pub capabilities: HashMap<String, bool>,
 
     // channels and contacts
@@ -58,7 +57,6 @@ pub struct IrcConfig {
 impl IrcConfig {
     pub fn new(settings: &Args) -> Result<Self> {
         let password = settings.password.as_ref().unwrap_or(&String::new()).clone();
-        // let private_key = settings.private_key.clone();
 
         let auto_channels = settings.autojoin.clone();
 

+ 0 - 13
bin/darkirc/src/settings.rs

@@ -82,9 +82,6 @@ pub struct Args {
     #[structopt(long)]
     pub password: Option<String>,
 
-    // /// Private key
-    // #[structopt(skip)]
-    // pub private_key: Option<String>,
     /// Network settings
     #[structopt(flatten)]
     pub net: SettingsOpt,
@@ -327,13 +324,3 @@ fn parse_priv_key(data: &str) -> Result<String> {
     info!("Found secret key in config, noted it down.");
     Ok(pk)
 }
-
-// fn parse_priv(key: &str) -> Result<crypto_box::SecretKey> {
-//     let bytes: [u8; 32] = bs58::decode(key).into_vec()?.try_into().unwrap();
-//     Ok(crypto_box::SecretKey::from(bytes))
-// }
-
-// fn parse_pub(key: &str) -> Result<crypto_box::PublicKey> {
-//     let bytes: [u8; 32] = bs58::decode(key).into_vec()?.try_into().unwrap();
-//     Ok(crypto_box::PublicKey::from(bytes))
-// }