Skip to content

Commit

Permalink
Merge pull request #2757 from subspace/farmer-improvements
Browse files Browse the repository at this point in the history
Farmer improvements
  • Loading branch information
nazar-pc authored May 13, 2024
2 parents 2097fcb + 045d809 commit 4d4ccd5
Show file tree
Hide file tree
Showing 17 changed files with 439 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub(in super::super) enum PlottingThreadPriority {
impl FromStr for PlottingThreadPriority {
type Err = String;

#[inline]
fn from_str(s: &str) -> anyhow::Result<Self, Self::Err> {
match s {
"min" => Ok(Self::Min),
Expand All @@ -37,6 +38,7 @@ impl FromStr for PlottingThreadPriority {
}

impl fmt::Display for PlottingThreadPriority {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::Min => "min",
Expand All @@ -47,6 +49,7 @@ impl fmt::Display for PlottingThreadPriority {
}

impl From<PlottingThreadPriority> for Option<ThreadPriority> {
#[inline]
fn from(value: PlottingThreadPriority) -> Self {
match value {
PlottingThreadPriority::Min => Some(ThreadPriority::Min),
Expand All @@ -69,6 +72,7 @@ pub(in super::super) struct DiskFarm {
impl FromStr for DiskFarm {
type Err = String;

#[inline]
fn from_str(s: &str) -> anyhow::Result<Self, Self::Err> {
let parts = s.split(',').collect::<Vec<_>>();
if parts.len() < 2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub(in super::super) enum SectorState {
}

impl fmt::Display for SectorState {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::NotPlotted => "NotPlotted",
Expand Down
Loading

0 comments on commit 4d4ccd5

Please sign in to comment.