Skip to content

Commit

Permalink
other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-lacroix committed Apr 4, 2024
1 parent b4d3195 commit 97e20f8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/project/manifest/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub enum RequirementConversionError {
#[derive(Error, Debug, Clone)]
pub enum TomlError {
#[error("{0}")]
Error(toml_edit::TomlError),
Error(#[from] toml_edit::TomlError),
#[error("Missing field `project`")]
NoProjectTable,
#[error("Missing field `name`")]
Expand All @@ -95,11 +95,11 @@ impl TomlError {
}
}

fn span(self) -> Option<std::ops::Range<usize>> {
fn span(&self) -> Option<std::ops::Range<usize>> {
match self {
TomlError::Error(e) => e.span(),
TomlError::NoProjectTable => Some(0..1),
TomlError::NoProjectName(span) => span,
TomlError::NoProjectName(span) => span.clone(),
}
}
fn message(&self) -> &str {
Expand All @@ -115,8 +115,3 @@ impl From<toml_edit::de::Error> for TomlError {
TomlError::Error(e.into())
}
}
impl From<toml_edit::TomlError> for TomlError {
fn from(e: toml_edit::TomlError) -> Self {
TomlError::Error(e)
}
}

0 comments on commit 97e20f8

Please sign in to comment.