diff --git a/boa_temporal/Cargo.toml b/boa_temporal/Cargo.toml index c9894970afd..058e64d3490 100644 --- a/boa_temporal/Cargo.toml +++ b/boa_temporal/Cargo.toml @@ -11,15 +11,16 @@ license.workspace = true repository.workspace = true rust-version.workspace = true - [dependencies] -icu_calendar = { version = "~1.3.2", default-features = false } tinystr = "0.7.4" -bitflags.workspace = true +icu_calendar = { workspace = true, default-features = false } rustc-hash = { workspace = true, features = ["std"] } num-bigint = { workspace = true, features = ["serde"] } +bitflags.workspace = true num-traits.workspace = true - [features] context = [] + +[lints] +workspace = true diff --git a/boa_temporal/src/lib.rs b/boa_temporal/src/lib.rs index 0015b1ad999..e2da7ee6825 100644 --- a/boa_temporal/src/lib.rs +++ b/boa_temporal/src/lib.rs @@ -6,59 +6,6 @@ html_favicon_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg" )] #![cfg_attr(not(test), forbid(clippy::unwrap_used))] -#![warn( - // rustc lint groups https://doc.rust-lang.org/rustc/lints/groups.html - warnings, - future_incompatible, - let_underscore, - nonstandard_style, - rust_2018_compatibility, - rust_2018_idioms, - rust_2021_compatibility, - unused, - - // rustc allowed-by-default lints https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html - missing_docs, - macro_use_extern_crate, - meta_variable_misuse, - missing_abi, - missing_copy_implementations, - missing_debug_implementations, - non_ascii_idents, - noop_method_call, - single_use_lifetimes, - trivial_casts, - trivial_numeric_casts, - unreachable_pub, - unsafe_op_in_unsafe_fn, - unused_crate_dependencies, - unused_import_braces, - unused_lifetimes, - unused_qualifications, - unused_tuple_struct_fields, - variant_size_differences, - - // rustdoc lints https://doc.rust-lang.org/rustdoc/lints.html - rustdoc::broken_intra_doc_links, - rustdoc::private_intra_doc_links, - rustdoc::missing_crate_level_docs, - rustdoc::private_doc_tests, - rustdoc::invalid_codeblock_attributes, - rustdoc::invalid_rust_codeblocks, - rustdoc::bare_urls, - - // clippy allowed by default - clippy::dbg_macro, - - // clippy categories https://doc.rust-lang.org/clippy/ - clippy::all, - clippy::correctness, - clippy::suspicious, - clippy::style, - clippy::complexity, - clippy::perf, - clippy::pedantic, -)] #![allow( // Currently throws a false positive regarding dependencies that are only used in benchmarks. unused_crate_dependencies, diff --git a/boa_temporal/src/utils.rs b/boa_temporal/src/utils.rs index 4660ba49dd1..2c0e1dd1621 100644 --- a/boa_temporal/src/utils.rs +++ b/boa_temporal/src/utils.rs @@ -156,7 +156,7 @@ pub(crate) fn epoch_time_to_epoch_year(t: f64) -> i32 { // roughly calculate the largest possible year given the time t, // then check and refine the year. let day_count = epoch_time_to_day_number(t); - let mut year = day_count / 365; + let mut year = (day_count / 365) + 1970; loop { if epoch_time_for_year(year) <= t { break; @@ -164,7 +164,7 @@ pub(crate) fn epoch_time_to_epoch_year(t: f64) -> i32 { year -= 1; } - year + 1970 + year } /// Returns either 1 (true) or 0 (false)