Commit 433f93d
Fix warnings by conditionally compiling Decimal support
This fixes the following Elixir 1.17 warnings when `:decimal` isn't
included in the dependency list:
```
==> jason
warning: Decimal.new/1 is undefined (module Decimal is not available or is yet to be defined)
│
94 │ decimal.new(string)
│ ~
│
└─ (jason 1.4.3) lib/decoder.ex:94:17: Jason.Decoder.float_decode_function/1
warning: struct Decimal.Error is undefined (module Decimal.Error is not available or is yet to be defined)
└─ (jason 1.4.3) lib/decoder.ex: Jason.Decoder.float_decode_function/1
warning: Decimal.to_string/2 is undefined (module Decimal is not available or is yet to be defined)
│
242 │ [?", decimal.to_string(value, :normal), ?"]
│ ~
│
└─ (jason 1.4.3) lib/encode.ex:242:18: Jason.Encode.struct/4
warning: Decimal.to_string/1 is undefined (module Decimal is not available or is yet to be defined)
│
231 │ [?", decimal.to_string(value), ?"]
│ ~
│
└─ (jason 1.4.3) lib/encoder.ex:231:18: Jason.Encoder.Decimal.encode/2
```1 parent eb1e92a commit 433f93d
3 files changed
+25
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
| |||
0 commit comments