Commit c92b79e4 authored by RazrFalcon's avatar RazrFalcon

Fixed build on Rust 1.29

parent 4d62d312
...@@ -108,20 +108,20 @@ Also, we do not test against Chrome, Firefox, Inkscape and Batik because they ha ...@@ -108,20 +108,20 @@ Also, we do not test against Chrome, Firefox, Inkscape and Batik because they ha
- [`xmlparser`](https://github.com/RazrFalcon/xmlparser) - an XML parser - [`xmlparser`](https://github.com/RazrFalcon/xmlparser) - an XML parser
- [`svgtypes`](https://github.com/RazrFalcon/svgtypes) - SVG types parser and writer - [`svgtypes`](https://github.com/RazrFalcon/svgtypes) - SVG types parser and writer
- [`rctree`](https://github.com/RazrFalcon/rctree) - a DOM-like tree - [`rctree`](https://github.com/RazrFalcon/rctree) - a DOM-like tree
- [`resvg-qt`](https://github.com/RazrFalcon/resvg-qt) - a minimal bindings for [Qt] - [`resvg-qt`](./resvg-qt) - a minimal bindings to [Qt]
All other dependencies aren't written by me for this project. All other dependencies aren't written by me for this project.
## Directory structure ## Directory structure
- `capi` - C/FFI interface for *resvg* - `capi` - C/FFI interface for *resvg*
- `docs` - Basic documentation - `docs` - basic documentation
- `examples` - *resvg* as a library usage examples - `examples` - *resvg* as a library usage examples
- `resvg-qt` - A minimal bindings to Qt used by *resvg* - `resvg-qt` - a minimal bindings to Qt used by *resvg*
- `src` - Source code - `src` - source code
- `testing_tools` - Scripts used for testing - `testing_tools` - scripts used for testing
- `tools` - Useful CLI tools - `tools` - useful CLI tools
- `usvg` - An SVG simplification library used by *resvg* - `usvg` - an SVG simplification library used by *resvg*
## Safety ## Safety
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
use std::process; use std::process;
use std::path; use std::path;
use gumdrop::Options as CliOptions; use gumdrop::Options;
use resvg::{ use resvg::{
self,
usvg, usvg,
FitTo, FitTo,
Options,
}; };
pub fn print_help() { pub fn print_help() {
...@@ -66,7 +66,7 @@ ARGS: ...@@ -66,7 +66,7 @@ ARGS:
backends().join(", ")); backends().join(", "));
} }
#[derive(Debug, CliOptions)] #[derive(Debug, Options)]
struct CliArgs { struct CliArgs {
#[options(no_short)] #[options(no_short)]
help: bool, help: bool,
...@@ -192,7 +192,7 @@ pub struct Args { ...@@ -192,7 +192,7 @@ pub struct Args {
pub quiet: bool, pub quiet: bool,
} }
pub fn parse() -> Result<(Args, Options), String> { pub fn parse() -> Result<(Args, resvg::Options), String> {
let args: Vec<String> = ::std::env::args().collect(); let args: Vec<String> = ::std::env::args().collect();
let args = match CliArgs::parse_args_default(&args[1..]) { let args = match CliArgs::parse_args_default(&args[1..]) {
Ok(v) => v, Ok(v) => v,
...@@ -257,7 +257,7 @@ pub fn parse() -> Result<(Args, Options), String> { ...@@ -257,7 +257,7 @@ pub fn parse() -> Result<(Args, Options), String> {
None => vec!["en".to_string()], // TODO: use system language None => vec!["en".to_string()], // TODO: use system language
}; };
let opt = Options { let opt = resvg::Options {
usvg: usvg::Options { usvg: usvg::Options {
path: Some(in_svg.into()), path: Some(in_svg.into()),
dpi: args.dpi as f64, dpi: args.dpi as f64,
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
use std::f64;
// external // external
use svgdom; use svgdom;
...@@ -71,7 +73,7 @@ fn convert_orientation(attrs: &svgdom::Attributes) -> tree::MarkerOrientation { ...@@ -71,7 +73,7 @@ fn convert_orientation(attrs: &svgdom::Attributes) -> tree::MarkerOrientation {
let a = match angle.unit { let a = match angle.unit {
svgdom::AngleUnit::Degrees => angle.num, svgdom::AngleUnit::Degrees => angle.num,
svgdom::AngleUnit::Gradians => angle.num * 180.0 / 200.0, svgdom::AngleUnit::Gradians => angle.num * 180.0 / 200.0,
svgdom::AngleUnit::Radians => angle.num * 180.0 / std::f64::consts::PI, svgdom::AngleUnit::Radians => angle.num * 180.0 / f64::consts::PI,
}; };
tree::MarkerOrientation::Angle(a) tree::MarkerOrientation::Angle(a)
......
...@@ -11,6 +11,7 @@ use std::path; ...@@ -11,6 +11,7 @@ use std::path;
// external // external
use svgdom; use svgdom;
use libflate;
// self // self
pub use self::nodes::*; pub use self::nodes::*;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment