Skip to content

Commit

Permalink
Ajustado build
Browse files Browse the repository at this point in the history
  • Loading branch information
caiocampos committed Sep 1, 2021
1 parent 434d6ce commit 8a578ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

echo linux build
cargo build --release --target=x86_64-unknown-linux-gnu

echo windows build
cargo build --release --target=x86_64-pc-windows-gnu
6 changes: 3 additions & 3 deletions src/lib/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ impl SVG {
fn load(&self) -> Result<SvgTree, String> {
let opt = SvgOptions::default();
let res = match self {
SVG::Str(origin) => SvgTree::from_str(origin, &opt),
SVG::Str(origin) => SvgTree::from_str(origin, &opt.to_ref()),
SVG::File(origin) => {
let svg_data = std::fs::read(&origin).unwrap();
SvgTree::from_data(&svg_data, &opt)
SvgTree::from_data(&svg_data, &opt.to_ref())
}
SVG::Data(origin) => SvgTree::from_data(origin, &opt),
SVG::Data(origin) => SvgTree::from_data(origin, &opt.to_ref()),
};
match res {
Ok(tree) => Ok(tree),
Expand Down

0 comments on commit 8a578ab

Please sign in to comment.