Skip to content

Commit f144936

Browse files
committed
Clean up unit import to top level
1 parent 0d3e75d commit f144936

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/DynamicQuantities.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ import .Constants
2929
import .UnitsParse: uparse, @u_str
3030

3131
using .Units: UNIT_SYMBOLS
32-
_units_import_expr = :(using .Units: m, g)
33-
append!(
34-
_units_import_expr.args[1].args,
35-
map(s -> Expr(:(.), s), UNIT_SYMBOLS)
36-
)
37-
eval(_units_import_expr)
32+
33+
# Copy all units to top level:
34+
let _units_import_expr = :(using .Units: m, g)
35+
append!(
36+
_units_import_expr.args[1].args,
37+
map(s -> Expr(:(.), s), filter(s -> s (:m, :g), UNIT_SYMBOLS))
38+
)
39+
eval(_units_import_expr)
40+
end
3841

3942

4043
function __init__()

0 commit comments

Comments
 (0)