Add Result alias (#271)
Adds a `yubikey::Result` alias with `yubikey::Error` as the error type. Since we only have one `Error` type, this simplifies the return types where a `Result` is returned.
This commit is contained in:
committed by
GitHub
parent
1051eaf26d
commit
de51b0cc46
+2
-3
@@ -31,11 +31,10 @@
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
use crate::{
|
||||
error::Error,
|
||||
metadata::{AdminData, ProtectedData},
|
||||
mgm::{MgmType, ADMIN_FLAGS_1_PROTECTED_MGM},
|
||||
yubikey::{YubiKey, ADMIN_FLAGS_1_PUK_BLOCKED},
|
||||
TAG_ADMIN_FLAGS_1, TAG_ADMIN_SALT, TAG_ADMIN_TIMESTAMP, TAG_PROTECTED_FLAGS_1,
|
||||
Result, TAG_ADMIN_FLAGS_1, TAG_ADMIN_SALT, TAG_ADMIN_TIMESTAMP, TAG_PROTECTED_FLAGS_1,
|
||||
TAG_PROTECTED_MGM,
|
||||
};
|
||||
use log::error;
|
||||
@@ -68,7 +67,7 @@ pub struct Config {
|
||||
|
||||
impl Config {
|
||||
/// Get YubiKey config
|
||||
pub fn get(yubikey: &mut YubiKey) -> Result<Config, Error> {
|
||||
pub fn get(yubikey: &mut YubiKey) -> Result<Config> {
|
||||
let mut config = Config {
|
||||
protected_data_available: false,
|
||||
puk_blocked: false,
|
||||
|
||||
Reference in New Issue
Block a user