summaryrefslogtreecommitdiff
path: root/ext/cache
diff options
context:
space:
mode:
Diffstat (limited to 'ext/cache')
-rw-r--r--ext/cache/lib.rs15
-rw-r--r--ext/cache/sqlite.rs14
2 files changed, 14 insertions, 15 deletions
diff --git a/ext/cache/lib.rs b/ext/cache/lib.rs
index c48b7cda4..8aab33268 100644
--- a/ext/cache/lib.rs
+++ b/ext/cache/lib.rs
@@ -1,8 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-mod sqlite;
-use deno_core::ByteString;
-pub use sqlite::SqliteBackedCache;
+use std::cell::RefCell;
+use std::path::PathBuf;
+use std::rc::Rc;
+use std::sync::Arc;
use async_trait::async_trait;
use deno_core::error::AnyError;
@@ -10,15 +11,13 @@ use deno_core::include_js_files;
use deno_core::op;
use deno_core::serde::Deserialize;
use deno_core::serde::Serialize;
+use deno_core::ByteString;
use deno_core::Extension;
use deno_core::OpState;
use deno_core::Resource;
use deno_core::ResourceId;
-
-use std::cell::RefCell;
-use std::path::PathBuf;
-use std::rc::Rc;
-use std::sync::Arc;
+mod sqlite;
+pub use sqlite::SqliteBackedCache;
#[derive(Clone)]
pub struct CreateCache<C: Cache + 'static>(pub Arc<dyn Fn() -> C>);
diff --git a/ext/cache/sqlite.rs b/ext/cache/sqlite.rs
index 2d8e83f4b..0252934e5 100644
--- a/ext/cache/sqlite.rs
+++ b/ext/cache/sqlite.rs
@@ -1,5 +1,12 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+use std::borrow::Cow;
+use std::path::PathBuf;
+use std::rc::Rc;
+use std::sync::Arc;
+use std::time::SystemTime;
+use std::time::UNIX_EPOCH;
+
use async_trait::async_trait;
use deno_core::error::AnyError;
use deno_core::parking_lot::Mutex;
@@ -13,13 +20,6 @@ use rusqlite::OptionalExtension;
use tokio::io::AsyncReadExt;
use tokio::io::AsyncWriteExt;
-use std::borrow::Cow;
-use std::path::PathBuf;
-use std::rc::Rc;
-use std::sync::Arc;
-use std::time::SystemTime;
-use std::time::UNIX_EPOCH;
-
use crate::deserialize_headers;
use crate::get_header;
use crate::serialize_headers;