daxpedda / web-time

Drop-in replacement for std::time for Wasm in browsers
Apache License 2.0
52 stars 8 forks source link

chore: silence unused qualifications warnings #32

Closed guillaumemichel closed 4 months ago

guillaumemichel commented 4 months ago

Silencing the following loud warnings.

warning: unnecessary qualification
  --> src/web.rs:22:21
   |
22 |     fn to_std(self) -> std::time::SystemTime;
   |                        ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: requested on the command line with `-W unused-qualifications`
help: remove the unnecessary path segments
   |
22 -     fn to_std(self) -> std::time::SystemTime;
22 +     fn to_std(self) -> SystemTime;
   |

warning: unnecessary qualification
  --> src/web.rs:35:20
   |
35 |     fn from_std(time: std::time::SystemTime) -> SystemTime;
   |                       ^^^^^^^^^^^^^^^^^^^^^
   |
help: remove the unnecessary path segments
   |
35 -     fn from_std(time: std::time::SystemTime) -> SystemTime;
35 +     fn from_std(time: SystemTime) -> SystemTime;
   |

warning: unnecessary qualification
  --> src/web.rs:39:21
   |
39 |     fn to_std(self) -> std::time::SystemTime {
   |                        ^^^^^^^^^^^^^^^^^^^^^
   |
help: remove the unnecessary path segments
   |
39 -     fn to_std(self) -> std::time::SystemTime {
39 +     fn to_std(self) -> SystemTime {
   |

warning: unnecessary qualification
  --> src/web.rs:46:20
   |
46 |     fn from_std(time: std::time::SystemTime) -> SystemTime {
   |                       ^^^^^^^^^^^^^^^^^^^^^
   |
help: remove the unnecessary path segments
   |
46 -     fn from_std(time: std::time::SystemTime) -> SystemTime {
46 +     fn from_std(time: SystemTime) -> SystemTime {
   |

Feel free to close if you prefer to address these warnings differently.

daxpedda commented 4 months ago

How exactly did you trigger this warning? I can't seem to reproduce it.

guillaumemichel commented 4 months ago

It shows up when building with RUSTFLAGS="--cfg docsrs"

RUSTFLAGS="--cfg docsrs" cargo +nightly build

However cargo doc doesn't show the warning, so feel free to close the PR if not relevant.

daxpedda commented 4 months ago

I documented that --cfg=docsrs is meant to be used with RUSTDOCFLAGS only in https://github.com/daxpedda/web-time/commit/8094078ed4f3f737c3047e09d24bb786408bc326.