From 0a51e5de08c50d6a15e79362edd6fcbed7b8a224 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 5 Feb 2022 00:25:48 +0800 Subject: [PATCH] chore: clean code --- src/main.rs | 4 +--- src/x509.rs | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 64e4514..53ca1e7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,9 +21,7 @@ use std::time::{Duration, SystemTime}; use std::str::FromStr; use tide::Request; use clap::{App, Arg}; -use async_std::task; -use async_std::channel; -use async_std::channel::Sender; +use async_std::{task, channel, channel::Sender}; use rust_util::util_cmd::run_command_and_wait; use crate::config::{AcmeMode, AcmeChallenge, CertConfig, CERT_NAME, KEY_NAME}; use crate::x509::{X509PublicKeyAlgo}; diff --git a/src/x509.rs b/src/x509.rs index 8bca061..f4a2b21 100644 --- a/src/x509.rs +++ b/src/x509.rs @@ -2,13 +2,10 @@ use std::error::Error; use std::str::FromStr; use serde::{Deserialize, Serialize}; use rust_util::XResult; -use x509_parser::parse_x509_certificate; -use x509_parser::pem::parse_x509_pem; +use x509_parser::{pem::parse_x509_pem, parse_x509_certificate}; use x509_parser::extensions::{ParsedExtension, GeneralName}; -use x509_parser::der_parser::oid::Oid; -use x509_parser::der_parser::parse_der; +use x509_parser::der_parser::{ber::BerObjectContent, oid::Oid, parse_der}; use x509_parser::x509::SubjectPublicKeyInfo; -use x509_parser::der_parser::ber::BerObjectContent; lazy_static! { static ref OID_COMMON_NAME: Oid<'static> = Oid::from_str("2.5.4.3").unwrap();