Skip to content

Commit

Permalink
vicky: rustfmt TaskBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
Kek5chen committed Apr 24, 2024
1 parent ecbe170 commit 6b97b1a
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions vicky/src/lib/documents/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub struct TaskBuilder {
status: TaskStatus,
locks: Vec<Lock>,
flake_ref: FlakeRef,
features: Vec<String>
features: Vec<String>,
}

impl Default for TaskBuilder {
Expand All @@ -76,8 +76,11 @@ impl Default for TaskBuilder {
display_name: None,
status: TaskStatus::NEW,
locks: Vec::new(),
flake_ref: FlakeRef { flake: "".to_string(), args: Vec::new() },
features: Vec::new()
flake_ref: FlakeRef {
flake: "".to_string(),
args: Vec::new(),
},
features: Vec::new(),
}
}
}
Expand All @@ -87,17 +90,17 @@ impl TaskBuilder {
self.id = Some(id);
self
}

pub fn with_display_name<S: Into<String>>(mut self, display_name: S) -> Self {
self.display_name = Some(display_name.into());
self
}

pub fn with_status(mut self, status: TaskStatus) -> Self {
self.status = status;
self
}

pub fn with_read_lock<S: Into<String>>(mut self, name: S) -> Self {
self.locks.push(Lock::READ { name: name.into() });
self
Expand All @@ -107,17 +110,17 @@ impl TaskBuilder {
self.locks.push(Lock::WRITE { name: name.into() });
self
}

pub fn with_locks(mut self, locks: Vec<Lock>) -> Self {
self.locks = locks;
self
}

pub fn with_flake<S: Into<FlakeURI>>(mut self, flake_uri: S) -> Self {
self.flake_ref.flake = flake_uri.into();
self
}

pub fn with_flake_arg<S: Into<String>>(mut self, flake_arg: S) -> Self {
self.flake_ref.args.push(flake_arg.into());
self
Expand All @@ -127,7 +130,7 @@ impl TaskBuilder {
self.flake_ref.args = args;
self
}

pub fn requires_feature<S: Into<String>>(mut self, feature: S) -> Self {
self.features.push(feature.into());
self
Expand Down Expand Up @@ -169,7 +172,7 @@ impl TaskBuilder {
features: self.features,
status: self.status,
locks: self.locks,
flake_ref: self.flake_ref
flake_ref: self.flake_ref,
}
}
}
Expand Down

0 comments on commit 6b97b1a

Please sign in to comment.