Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v0.8-pre' into Remove-panic-in-d…
Browse files Browse the repository at this point in the history
…essin-pdf---issues-#97
  • Loading branch information
SadCl0wn committed Dec 18, 2024
2 parents b991290 + bde61d8 commit f354892
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ members = [
]

[workspace.package]
version = "0.8.20-pre"
version = "0.8.21-pre"
license = "MIT"
edition = "2021"
repository = "https://github.com/432-Technologies/dessin"
Expand Down
4 changes: 2 additions & 2 deletions dessin-image/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ edition = "2021"
license = "MIT"
name = "dessin-image"
repository = "https://github.com/432-technologies/dessin"
version = "0.8.20-pre"
version = "0.8.21-pre"

[dependencies]
data-encoding = "^2.3.3"
dessin = { version = "0.8.20-pre", path = "../dessin" }
dessin = { version = "0.8.21-pre", path = "../dessin" }
font-kit = "0.11.0"
image = "0.24"
imageproc = "^0.23.0"
Expand Down
2 changes: 1 addition & 1 deletion dessin-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2021"
license = "MIT"
name = "dessin-macros"
repository = "https://github.com/432-technologies/dessin"
version = "0.8.20-pre"
version = "0.8.21-pre"

[lib]
proc-macro = true
Expand Down
10 changes: 8 additions & 2 deletions dessin-macros/src/dessin_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use syn::{
parse::{Parse, ParseStream},
punctuated::Punctuated,
token::{Brace, Bracket, Comma, Paren},
Expr, ExprAssign, ExprForLoop, ExprLet, Path, Result, Token,
Expr, ExprAssign, ExprForLoop, ExprLet, Pat, Path, Result, Token,
};

enum Action {
Expand Down Expand Up @@ -195,7 +195,13 @@ enum DessinIfElseArg {
impl Parse for DessinIfElseArg {
fn parse(input: ParseStream) -> Result<Self> {
if input.peek(Token![let]) {
let let_exp: ExprLet = input.parse()?;
let let_exp = ExprLet {
attrs: vec![],
let_token: input.parse().unwrap(),
pat: Box::new(Pat::parse_single(&input).unwrap()),
eq_token: input.parse().unwrap(),
expr: Box::new(Expr::parse_without_eager_brace(&input).unwrap()),
};
return Ok(DessinIfElseArg::Let(let_exp));
}

Expand Down
18 changes: 9 additions & 9 deletions dessin-macros/src/dessin_macro_old.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,15 +642,15 @@ fn simple_if() {
)
.unwrap();
}
#[test]
fn if_let() {
syn::parse_str::<Dessin>(
"if let Some(x) = my_condition {
Circle: ()
}",
)
.unwrap();
}
// #[test]
// fn if_let() {
// syn::parse_str::<Dessin>(
// "if let Some(x) = my_condition {
// Circle: ()
// }",
// )
// .unwrap();
// }
#[test]
fn combined_if() {
syn::parse_str::<Dessin>(
Expand Down
4 changes: 2 additions & 2 deletions dessin-pdf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ edition = "2021"
license = "MIT"
name = "dessin-pdf"
repository = "https://github.com/432-technologies/dessin"
version = "0.8.20-pre"
version = "0.8.21-pre"

[dependencies]
dessin = { version = "0.8.20-pre", path = "../dessin" }
dessin = { version = "0.8.21-pre", path = "../dessin" }
fontdue = "^0.9"
image = "0.24"
nalgebra = "^0.33"
Expand Down
2 changes: 2 additions & 0 deletions dessin-pdf/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use dessin::font::FontRef;
use dessin::{
export::{Export, Exporter},
font::FontRef,
Expand Down Expand Up @@ -294,6 +295,7 @@ impl Exporter for PDFExporter<'_> {
) -> Result<(), Self::Error> {
let font = font.clone().unwrap_or(FontRef::default());

// search if (font_ref, font_weight) is stocked in used_font
let font = self
.used_font
.entry((font.clone(), font_weight))
Expand Down
4 changes: 2 additions & 2 deletions dessin-svg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ edition = "2021"
license = "MIT"
name = "dessin-svg"
repository = "https://github.com/432-technologies/dessin"
version = "0.8.20-pre"
version = "0.8.21-pre"

[dependencies]
data-encoding = "^2.6.0"
dessin = { version = "0.8.20-pre", path = "../dessin" }
dessin = { version = "0.8.21-pre", path = "../dessin" }
image = "0.24"
nalgebra = "^0.33"
rand = "^0.8.5"
4 changes: 2 additions & 2 deletions dessin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ edition = "2021"
license = "MIT"
name = "dessin"
repository = "https://github.com/432-technologies/dessin"
version = "0.8.20-pre"
version = "0.8.21-pre"

[features]
default = ["default-font"]
default-font = []

[dependencies]
dessin-macros = { path = "../dessin-macros", version = "0.8.20-pre" }
dessin-macros = { path = "../dessin-macros", version = "0.8.21-pre" }
fontdue = "^0.9"
image = "0.24"
nalgebra = "^0.33"
Expand Down
8 changes: 4 additions & 4 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ publish = false
edition = "2021"

[dev-dependencies]
dessin = { version = "0.8.20-pre", path = "../dessin" }
dessin-svg = { version = "0.8.20-pre", path = "../dessin-svg" }
dessin-image = { version = "0.8.20-pre", path = "../dessin-image" }
dessin-pdf = { version = "0.8.20-pre", path = "../dessin-pdf" }
dessin = { version = "0.8.21-pre", path = "../dessin" }
dessin-svg = { version = "0.8.21-pre", path = "../dessin-svg" }
dessin-image = { version = "0.8.21-pre", path = "../dessin-image" }
dessin-pdf = { version = "0.8.21-pre", path = "../dessin-pdf" }
project-root = "0.2.2"

[[example]]
Expand Down

0 comments on commit f354892

Please sign in to comment.