summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDheepak Krishnamurthy <me@kdheepak.com>2021-02-13 17:02:49 -0700
committerDheepak Krishnamurthy <me@kdheepak.com>2021-02-13 18:24:47 -0700
commitcb941f503b91d207cabbf98f7b49394a6c747737 (patch)
tree638b2d04f8765437a74352e9a61bf598c933221e
parentbda6f4ef71140916fe163b19d78c78c616819ea1 (diff)
Make priority a string type
-rw-r--r--examples/import_task.rs2
-rw-r--r--src/import.rs2
-rw-r--r--src/priority.rs19
-rw-r--r--src/task.rs2
4 files changed, 6 insertions, 19 deletions
diff --git a/examples/import_task.rs b/examples/import_task.rs
index d1a481b..ca6ba04 100644
--- a/examples/import_task.rs
+++ b/examples/import_task.rs
@@ -15,7 +15,7 @@ fn main() {
assert_eq!(*t.status(), TaskStatus::Pending);
assert_eq!(*t.description(), "Test task".to_owned());
assert_eq!(t.priority(), None);
+ assert_eq!(t.uda().get("priority"), None);
println!("Successfully imported:\n{:?}", t);
}
-
diff --git a/src/import.rs b/src/import.rs
index 68009b1..3d6c4e9 100644
--- a/src/import.rs
+++ b/src/import.rs
@@ -165,7 +165,7 @@ fn test_one_single() {
assert!(task.project() == Some(&String::from("someproject")));
if let Some(tags) = task.tags() {
for tag in tags {
- let any_tag = ["some", "tags", "are", "here"].into_iter().any(
+ let any_tag = ["some", "tags", "are", "here"].iter().any(
|t| tag == *t,
);
assert!(any_tag, "Tag {} missing", tag);
diff --git a/src/priority.rs b/src/priority.rs
index b0d33a4..6a04763 100644
--- a/src/priority.rs
+++ b/src/priority.rs
@@ -4,20 +4,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
-//! Module containing TaskPriority types and trait impls
+//! Module containing `TaskPriority` type
-/// Enum for the priorities taskwarrior supports.
-#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
-pub enum TaskPriority {
- /// Low prio for a Task
- #[serde(rename = "L")]
- Low,
-
- /// Medium prio for a Task
- #[serde(rename = "M")]
- Medium,
-
- /// High prio for a Task
- #[serde(rename = "H")]
- High,
-}
+/// type definition for TaskPriority
+pub type TaskPriority = String;
diff --git a/src/task.rs b/src/task.rs
index 89d35d9..3fa0c12 100644
--- a/src/task.rs
+++ b/src/task.rs
@@ -932,7 +932,7 @@ mod test {
if let Some(tags) = task.tags() {
for tag in tags {
- let any_tag = ["some", "tags", "are", "here"].into_iter().any(
+ let any_tag = ["some", "tags", "are", "here"].iter().any(
|t| tag == *t,
);
assert!(any_tag, "Tag {} missing", tag);