1 | [package] |
2 | autobenches = false |
3 | categories = ["api-bindings" , "date-and-time" , "wasm" ] |
4 | description = "Drop-in replacement for std::time for Wasm in browsers" |
5 | edition = "2021" |
6 | include = ["CHANGELOG.md" , "LICENSE-*" , "src/**/*" ] |
7 | keywords = ["instant" , "wasm" , "web" , "systemtime" , "time" ] |
8 | license = "MIT OR Apache-2.0" |
9 | name = "web-time" |
10 | repository = "https://github.com/daxpedda/web-time" |
11 | rust-version = "1.60" |
12 | version = "1.1.0" |
13 | |
14 | [features] |
15 | serde = ["dep:serde" ] |
16 | |
17 | [target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies] |
18 | js-sys = "0.3.20" |
19 | serde = { version = "1" , optional = true } |
20 | wasm-bindgen = { version = "0.2.70" , default-features = false } |
21 | |
22 | [dev-dependencies] |
23 | static_assertions = "1" |
24 | |
25 | [target.'cfg(not(target_family = "wasm"))'.dev-dependencies] |
26 | pollster = { version = "0.3" , features = ["macro" ] } |
27 | |
28 | [target.'cfg(target_family = "wasm")'.dev-dependencies] |
29 | getrandom = { version = "0.2" , features = ["js" ] } |
30 | rand = "0.8" |
31 | serde_json = "1" |
32 | wasm-bindgen-futures = "0.4" |
33 | wasm-bindgen-test = "0.3" |
34 | web-sys = { version = "0.3" , features = [ |
35 | "CssStyleDeclaration" , |
36 | "Document" , |
37 | "Element" , |
38 | "HtmlTableElement" , |
39 | "HtmlTableRowElement" , |
40 | "Performance" , |
41 | "Window" , |
42 | ] } |
43 | |
44 | [target.'cfg(all(target_family = "wasm", target_feature = "atomics"))'.dev-dependencies] |
45 | futures-channel = { version = "0.3" , default-features = false, features = ["alloc" ] } |
46 | futures-util = { version = "0.3" , default-features = false } |
47 | wasm-worker = { git = "https://github.com/daxpedda/wasm-worker" , rev = "8b3e6324bdb5d44d5565b6981ce74ee773da9e3f" } |
48 | web-sys = { version = "0.3" , features = ["WorkerGlobalScope" ] } |
49 | |
50 | [profile.bench] |
51 | codegen-units = 1 |
52 | lto = true |
53 | |
54 | [[example]] |
55 | name = "benchmark" |
56 | path = "benches/benchmark.rs" |
57 | |
58 | [[test]] |
59 | name = "serde" |
60 | path = "tests/serde.rs" |
61 | required-features = ["serde" ] |
62 | |
63 | [package.metadata.docs.rs] |
64 | all-features = true |
65 | rustdoc-args = ["--cfg=docsrs" ] |
66 | targets = ["wasm32-unknown-unknown" ] |
67 | |
68 | [lints.rust] |
69 | # Rust groups. |
70 | future_incompatible = { level = "warn" , priority = -1 } |
71 | rust_2018_compatibility = { level = "warn" , priority = -1 } |
72 | rust_2018_idioms = { level = "warn" , priority = -1 } |
73 | rust_2021_compatibility = { level = "warn" , priority = -1 } |
74 | unused = { level = "warn" , priority = -1 } |
75 | # Rust lints. |
76 | deprecated_in_future = "warn" |
77 | ffi_unwind_calls = "warn" |
78 | macro_use_extern_crate = "warn" |
79 | meta_variable_misuse = "warn" |
80 | missing_abi = "warn" |
81 | missing_copy_implementations = "warn" |
82 | missing_debug_implementations = "warn" |
83 | missing_docs = "warn" |
84 | non_ascii_idents = "warn" |
85 | single_use_lifetimes = "warn" |
86 | trivial_casts = "warn" |
87 | trivial_numeric_casts = "warn" |
88 | unreachable_pub = "warn" |
89 | unsafe_code = "deny" |
90 | unsafe_op_in_unsafe_fn = "warn" |
91 | unused_import_braces = "warn" |
92 | unused_lifetimes = "warn" |
93 | unused_qualifications = "warn" |
94 | |
95 | [lints.clippy] |
96 | # Clippy groups. |
97 | cargo = { level = "warn" , priority = -1 } |
98 | nursery = { level = "warn" , priority = -1 } |
99 | pedantic = { level = "warn" , priority = -1 } |
100 | # Clippy restriction lints. |
101 | absolute_paths = "warn" |
102 | allow_attributes = "warn" |
103 | allow_attributes_without_reason = "warn" |
104 | as_conversions = "warn" |
105 | assertions_on_result_states = "warn" |
106 | clone_on_ref_ptr = "warn" |
107 | create_dir = "warn" |
108 | dbg_macro = "warn" |
109 | decimal_literal_representation = "warn" |
110 | default_union_representation = "warn" |
111 | empty_drop = "warn" |
112 | empty_structs_with_brackets = "warn" |
113 | error_impl_error = "warn" |
114 | exit = "warn" |
115 | filetype_is_file = "warn" |
116 | float_cmp_const = "warn" |
117 | fn_to_numeric_cast_any = "warn" |
118 | format_push_string = "warn" |
119 | get_unwrap = "warn" |
120 | if_then_some_else_none = "warn" |
121 | impl_trait_in_params = "warn" |
122 | indexing_slicing = "warn" |
123 | infinite_loop = "warn" |
124 | large_include_file = "warn" |
125 | lossy_float_literal = "warn" |
126 | min_ident_chars = "warn" |
127 | missing_assert_message = "warn" |
128 | missing_asserts_for_indexing = "warn" |
129 | missing_docs_in_private_items = "warn" |
130 | mixed_read_write_in_expression = "warn" |
131 | mutex_atomic = "warn" |
132 | non_ascii_literal = "warn" |
133 | partial_pub_fields = "warn" |
134 | print_stderr = "warn" |
135 | print_stdout = "warn" |
136 | pub_without_shorthand = "warn" |
137 | rc_buffer = "warn" |
138 | rc_mutex = "warn" |
139 | redundant_type_annotations = "warn" |
140 | ref_patterns = "warn" |
141 | rest_pat_in_fully_bound_structs = "warn" |
142 | same_name_method = "warn" |
143 | self_named_module_files = "warn" |
144 | semicolon_outside_block = "warn" |
145 | single_char_lifetime_names = "warn" |
146 | str_to_string = "warn" |
147 | string_add = "warn" |
148 | string_lit_chars_any = "warn" |
149 | string_slice = "warn" |
150 | string_to_string = "warn" |
151 | suspicious_xor_used_as_pow = "warn" |
152 | todo = "warn" |
153 | try_err = "warn" |
154 | undocumented_unsafe_blocks = "warn" |
155 | unimplemented = "warn" |
156 | unnecessary_safety_doc = "warn" |
157 | unnecessary_self_imports = "warn" |
158 | unneeded_field_pattern = "warn" |
159 | unseparated_literal_suffix = "warn" |
160 | unwrap_used = "warn" |
161 | use_debug = "warn" |
162 | verbose_file_reads = "warn" |
163 | # Allowed Clippy lints. |
164 | equatable_if_let = "allow" |
165 | explicit_deref_methods = "allow" |
166 | future_not_send = "allow" |
167 | module_inception = "allow" |
168 | module_name_repetitions = "allow" |
169 | option_if_let_else = "allow" |
170 | redundant_pub_crate = "allow" |
171 | tabs_in_doc_comments = "allow" |
172 | |
173 | [lints.rustdoc] |
174 | all = { level = "warn" , priority = -1 } |
175 | |