Skip to content

Commit

Permalink
build(deps): downgrade kdl to 4.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hougesen committed Nov 16, 2024
1 parent 014db2c commit e6a5335
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 29 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [Unreleased](https://github.com/hougesen/kdlfmt/compare/v0.0.5...HEAD)

- build(deps): downgrade kdl to 4.6.0 [`#47`](https://github.com/hougesen/kdlfmt/pull/47)
- build(deps): bump clap_complete from 4.5.33 to 4.5.36 [`#46`](https://github.com/hougesen/kdlfmt/pull/46)
- chore: bump version to 0.0.6 [`85182b7`](https://github.com/hougesen/kdlfmt/commit/85182b7fcf5f6fb15bb592d8299447de5d5073f2)

#### [v0.0.5](https://github.com/hougesen/kdlfmt/compare/v0.0.4...v0.0.5)

> 23 October 2024
Expand Down
36 changes: 13 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ clap_complete = "4.5.36"
console = "0.15.8"
env_logger = "0.11.5"
ignore = "0.4.23"
kdl = "6.0.0-alpha.1"
kdl = "4.6.0"
log = "0.4.22"
3 changes: 1 addition & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pub enum KdlFmtError {
IoError(std::io::Error),
InvalidPathError(String),
ParseError(Option<std::path::PathBuf>, kdl::KdlParseFailure),
ParseError(Option<std::path::PathBuf>, kdl::KdlError),
ReadStdinError(std::io::Error),
CheckModeChanges,
}
Expand All @@ -21,7 +21,6 @@ impl std::fmt::Display for KdlFmtError {
}
}
Self::InvalidPathError(path) => write!(f, "'{path}' is not a valid path"),

Self::CheckModeChanges => write!(f, "Found changes while running in check mode"),
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/kdl.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#[inline]
pub fn parse_kdl(input: &str) -> Result<kdl::KdlDocument, kdl::KdlParseFailure> {
input.parse::<kdl::KdlDocument>()
pub fn parse_kdl(input: &str) -> Result<kdl::KdlDocument, kdl::KdlError> {
let parsed = input.parse::<kdl::KdlDocument>()?;

Ok(parsed)
}

#[inline]
pub fn format_kdl(mut input: kdl::KdlDocument) -> String {
input.autoformat();
input.fmt();

input.to_string()
}
Expand Down

0 comments on commit e6a5335

Please sign in to comment.