feat: copying entry fields

This commit is contained in:
electria 2026-08-26 11:59:23 -07:00
commit b7c5a05c6e
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs
4 changed files with 420 additions and 476 deletions

View file

@ -1,5 +1,32 @@
use std::{fs, io};
#[derive(Clone, Copy, Default, PartialEq, Eq)]
pub enum BasicField {
Title,
#[default]
Username,
Password,
Url,
}
impl BasicField {
pub fn next(&mut self) {
*self = match self {
Self::Title => Self::Username,
Self::Username => Self::Password,
Self::Password => Self::Url,
Self::Url => Self::Title,
}
}
pub fn previous(&mut self) {
*self = match self {
Self::Title => Self::Url,
Self::Username => Self::Title,
Self::Password => Self::Username,
Self::Url => Self::Password,
}
}
}
pub fn get_last_opened() -> io::Result<String> {
Ok(fs::read_to_string(
dirs::data_dir()