summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-27 10:58:54 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-27 10:58:54 +0200
commit5b09f60a408b743e78640d850854901a3565274c (patch)
treead512a4a2e51b99b7c3eb8cfa621e4096df06a7d
parent2d7dd4be132fa90965017ae46a16009cd67cdf8c (diff)
downloadobnam2-5b09f60a408b743e78640d850854901a3565274c.tar.gz
refactor: avoid confusing function name from_str
-rw-r--r--src/backup_reason.rs2
-rw-r--r--src/generation.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backup_reason.rs b/src/backup_reason.rs
index f785dea..0a51556 100644
--- a/src/backup_reason.rs
+++ b/src/backup_reason.rs
@@ -14,7 +14,7 @@ pub enum Reason {
}
impl Reason {
- pub fn from_str(text: &str) -> Reason {
+ pub fn from(text: &str) -> Reason {
match text {
"skipped" => Reason::Skipped,
"new" => Reason::IsNew,
diff --git a/src/generation.rs b/src/generation.rs
index 240f46a..174247a 100644
--- a/src/generation.rs
+++ b/src/generation.rs
@@ -162,7 +162,7 @@ pub struct BackedUpFile {
impl BackedUpFile {
pub fn new(fileno: FileId, entry: FilesystemEntry, reason: &str) -> Self {
- let reason = Reason::from_str(reason);
+ let reason = Reason::from(reason);
Self {
fileno,
entry,