Skip to content

Commit

Permalink
macros: Drop anyhow dependency
Browse files Browse the repository at this point in the history
It is used in a single place and it is easy to remove, so it doesn't
seem
worth it to keep depending on it.
  • Loading branch information
zecakeh authored and bilelmoussaoui committed Apr 21, 2024
1 parent 4e4b74e commit 7cf87d9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion gtk4-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ xml_validation = ["quick-xml"]
blueprint = []

[dependencies]
anyhow = "1.0"
quick-xml = {version = "0.31", optional = true}
proc-macro-crate = "3.0"
proc-macro2 = "1.0"
Expand Down
6 changes: 2 additions & 4 deletions gtk4-macros/src/blueprint.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file.

use std::{
io::{Read, Write},
io::{Error, ErrorKind, Read, Result, Write},
process::{Command, Stdio},
};

use anyhow::{bail, Result};

pub(crate) fn compile_blueprint(blueprint: &[u8]) -> Result<String> {
let mut compiler = Command::new("blueprint-compiler")
.args(["compile", "-"])
Expand All @@ -24,7 +22,7 @@ pub(crate) fn compile_blueprint(blueprint: &[u8]) -> Result<String> {
compiler.stdout.unwrap().read_to_string(&mut buf)?;

if !buf.starts_with('<') {
bail!(buf);
return Err(Error::new(ErrorKind::Other, buf));
}

Ok(buf)
Expand Down

0 comments on commit 7cf87d9

Please sign in to comment.