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:
Tony Arcieri (iqlusion)
2021-07-11 09:44:08 -07:00
committed by GitHub
parent 1051eaf26d
commit de51b0cc46
23 changed files with 210 additions and 223 deletions
+2 -3
View File
@@ -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,