Skip to content

Commit

Permalink
refactor: Make size of parser_deser::error::Error smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Jan 14, 2024
1 parent 67dc1d3 commit 82768a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gen/carapace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl Completion {

/// Generate a Carapace spec from a [`CommandInfo`]
pub fn generate(cmd: &CommandInfo) -> String {
let yaml = serde_yaml::to_string(&to_carapace(&cmd))
let yaml = serde_yaml::to_string(&to_carapace(cmd))
.expect("Carapace spec should've been serialized to YAML");
format!("{}\n{}", HEADER, yaml)
}
Expand Down
2 changes: 1 addition & 1 deletion src/parse_deser/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub enum Error {
#[source_code]
source_code: NamedSource,
#[source]
error: DeserError,
error: Box<DeserError>,
},
}

Expand Down
2 changes: 1 addition & 1 deletion src/parse_deser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn parse(file: impl AsRef<Path>) -> Result<CommandInfo> {
};
parse_from_str(&text, format).map_err(|error| Error::Deser {
source_code: NamedSource::new(file_path, text),
error,
error: Box::new(error),
})
} else {
Err(Error::UnrecognizableExtension { file_path })
Expand Down

0 comments on commit 82768a3

Please sign in to comment.