track/models/
todo_add_options.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub struct TodoAddOptions {
4 pub worktree_requested: bool,
6 pub requires_workspace: bool,
8}
9
10impl Default for TodoAddOptions {
11 fn default() -> Self {
12 Self {
13 worktree_requested: false,
14 requires_workspace: true,
15 }
16 }
17}
18
19impl TodoAddOptions {
20 pub fn from_flags(worktree: bool, no_workspace: bool) -> Self {
21 Self {
22 worktree_requested: worktree,
23 requires_workspace: !no_workspace,
24 }
25 }
26}
27
28impl From<bool> for TodoAddOptions {
29 fn from(worktree_requested: bool) -> Self {
31 Self::from_flags(worktree_requested, false)
32 }
33}