diff options
| author | Yang Hau <vulxj0j8j8@gmail.com> | 2023-06-07 07:42:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-07 14:42:58 +0200 |
| commit | 0dc1776202149bb59c21d1db8efe2a10c409b6e6 (patch) | |
| tree | 559458439d86e43ec5376e33db7cc18b5139caca | |
| parent | 3d3ea9016f339b3753fc7e4c909d6a522a0b7a75 (diff) | |
refactor: Replace once_cell to std lib (#1402)
| -rw-r--r-- | .github/workflows/ci.yml | 2 | ||||
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | cli/src/main.rs | 2 | ||||
| -rw-r--r-- | src/eval/library.rs | 4 | ||||
| -rw-r--r-- | tests/src/tests.rs | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea0c5054..c6743f86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@1.67.0 + - uses: dtolnay/rust-toolchain@1.70.0 - uses: Swatinem/rust-cache@v2 - run: cargo check --workspace @@ -4,7 +4,7 @@ default-members = ["cli"] [workspace.package] version = "0.4.0" -rust-version = "1.67" +rust-version = "1.70" # also change in ci.yml authors = ["The Typst Project Developers"] edition = "2021" homepage = "https://typst.app" diff --git a/cli/src/main.rs b/cli/src/main.rs index d0cf6139..9756c168 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -18,9 +18,9 @@ use comemo::Prehashed; use elsa::FrozenVec; use memmap2::Mmap; use notify::{RecommendedWatcher, RecursiveMode, Watcher}; -use once_cell::unsync::OnceCell; use same_file::{is_same_file, Handle}; use siphasher::sip128::{Hasher128, SipHasher13}; +use std::cell::OnceCell; use termcolor::{ColorChoice, StandardStream, WriteColor}; use typst::diag::{FileError, FileResult, SourceError, StrResult}; use typst::doc::Document; diff --git a/src/eval/library.rs b/src/eval/library.rs index 0067bf57..4978ada2 100644 --- a/src/eval/library.rs +++ b/src/eval/library.rs @@ -4,7 +4,7 @@ use std::num::NonZeroUsize; use comemo::Tracked; use ecow::EcoString; -use once_cell::sync::OnceCell; +use std::sync::OnceLock; use super::{Args, Dynamic, Module, Value, Vm}; use crate::diag::SourceResult; @@ -158,7 +158,7 @@ impl Hash for LangItems { /// Global storage for lang items. #[doc(hidden)] -pub static LANG_ITEMS: OnceCell<LangItems> = OnceCell::new(); +pub static LANG_ITEMS: OnceLock<LangItems> = OnceLock::new(); /// Set the lang items. /// diff --git a/tests/src/tests.rs b/tests/src/tests.rs index bf3d19c1..debb3c92 100644 --- a/tests/src/tests.rs +++ b/tests/src/tests.rs @@ -13,9 +13,9 @@ use std::{env, io}; use clap::Parser; use comemo::{Prehashed, Track}; use elsa::FrozenVec; -use once_cell::unsync::OnceCell; use oxipng::{InFile, Options, OutFile}; use rayon::iter::{ParallelBridge, ParallelIterator}; +use std::cell::OnceCell; use tiny_skia as sk; use unscanny::Scanner; use walkdir::WalkDir; |
