Skip to content

Commit

Permalink
Don't require models to import HashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jun 2, 2022
1 parent 2493ffd commit b8af61b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion crates/fj-proc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ pub fn model(_: TokenStream, input: TokenStream) -> TokenStream {

let function_boilerplate = quote! {
#[no_mangle]
pub extern "C" fn model(args: &HashMap<String, String>) -> fj::Shape
pub extern "C" fn model(
args: &std::collections::HashMap<String, String>
) -> fj::Shape
};

quote! {
Expand Down
2 changes: 0 additions & 2 deletions models/cuboid/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashMap;

#[fj::model]
pub fn model(
#[value(default = 3.0)] x: f64,
Expand Down
2 changes: 0 additions & 2 deletions models/spacer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashMap;

use fj::syntax::*;

#[fj::model]
Expand Down
2 changes: 1 addition & 1 deletion models/star/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use fj::Angle;
use std::{collections::HashMap, f64::consts::PI};
use std::f64::consts::PI;
extern crate fj;

#[fj::model]
Expand Down
2 changes: 1 addition & 1 deletion models/test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, f64::consts::PI};
use std::f64::consts::PI;

use fj::{syntax::*, Angle};

Expand Down

0 comments on commit b8af61b

Please sign in to comment.