Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Media
[patch.crates-io]
deno_core = { git = "https://github.com/supabase/deno_core", branch = "324-supabase" }
eszip = { git = "https://github.com/supabase/eszip", branch = "fix-pub-vis-0-80-1" }
v8 = { git = "https://github.com/supabase/rusty_v8", tag = "v130.0.7" }
v8 = { git = "https://github.com/supabase/rusty_v8", tag = "v130.0.7-patch.1" }

deno_unsync = { path = "./vendor/deno_unsync" }
deno_fetch = { path = "./vendor/deno_fetch" }
Expand Down
4 changes: 2 additions & 2 deletions crates/base/src/inspector_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,13 @@ impl InspectorInfo {
}

pub fn get_websocket_debugger_url(&self, host: &str) -> String {
format!("ws://{}/ws/{}", host, &self.uuid)
format!("ws://{}/ws/{}", host, self.uuid)
}

fn get_frontend_url(&self, host: &str) -> String {
format!(
"devtools://devtools/bundled/js_app.html?ws={}/ws/{}&experiments=true&v8only=true",
host, &self.uuid
host, self.uuid
)
}

Expand Down
2 changes: 2 additions & 0 deletions crates/base/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)] // ctor's implementation checks an internal feature in the caller.

extern crate core;

mod inspector_server;
Expand Down
2 changes: 1 addition & 1 deletion crates/base/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ where
metadata
.static_assets_lookup(static_root_path)
.into_iter()
.chain(static_files.into_iter())
.chain(static_files)
.collect()
} else {
static_files
Expand Down
1 change: 1 addition & 0 deletions crates/base/src/runtime/unsync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ impl<R> MaskValueAsSend<R> {
}
}

#[allow(dead_code)] // Used by optional runtime configurations.
pub struct MaskFutureAsSend<Fut> {
pub fut: MaskValueAsSend<Fut>,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/base/src/utils/dirs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod internal {

pub fn home_dir() -> Option<PathBuf> {
std::env::var_os("HOME")
.and_then(|h| if h.is_empty() { None } else { Some(h) })
.filter(|h| !h.is_empty())
.or_else(|| {
// TODO(bartlomieju):
#[allow(clippy::undocumented_unsafe_blocks)]
Expand Down
15 changes: 6 additions & 9 deletions crates/base/src/worker/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,13 @@ use crate::inspector_server::Inspector;
use crate::server::ServerFlags;
use crate::worker::WorkerSurfaceBuilder;

#[derive(Debug, Clone, Copy, EnumAsInner)]
#[derive(Debug, Clone, Copy, EnumAsInner, Default)]
pub enum SupervisorPolicy {
#[default]
PerWorker,
PerRequest { oneshot: bool },
}

impl Default for SupervisorPolicy {
fn default() -> Self {
Self::PerWorker
}
PerRequest {
oneshot: bool,
},
}

impl FromStr for SupervisorPolicy {
Expand Down Expand Up @@ -294,7 +291,7 @@ impl WorkerPool {
let force_create = worker_options
.conf
.as_user_worker()
.map_or(false, |it| !is_oneshot_policy && it.force_create);
.is_some_and(|it| !is_oneshot_policy && it.force_create);

if let Some(ref active_worker_uuid) =
self.maybe_active_worker(&service_path, force_create)
Expand Down
2 changes: 1 addition & 1 deletion crates/base/tests/eszip_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ where
let buf = read(path.as_ref()).await?;
let eszip = EszipPayloadKind::VecKind(buf.clone());
let metadata_path =
PathBuf::from(format!("{}.metadata", &path.as_ref().to_string_lossy()));
PathBuf::from(format!("{}.metadata", path.as_ref().to_string_lossy()));
let metadata = if metadata_path.exists() {
let buf = read(metadata_path).await?;
Some(serde_json::from_slice::<serde_json::Value>(&buf)?)
Expand Down
3 changes: 1 addition & 2 deletions crates/base/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use base::server::ServerEvent;
use base::server::ServerFlags;
use base::server::ServerHealth;
use base::server::Tls;
use base::utils::test_utils;
use base::utils::test_utils::create_test_user_worker;
use base::utils::test_utils::ensure_npm_package_installed;
use base::utils::test_utils::test_user_runtime_opts;
Expand Down Expand Up @@ -3388,7 +3387,7 @@ async fn test_commonjs_hono() {
async fn test_commonjs_websocket(prefix: String) {
ensure_npm_package_installed(format!(
"./test_cases/commonjs-{}-websocket",
&prefix
prefix
))
.await;
let nonce = tungstenite::handshake::client::generate_key();
Expand Down
7 changes: 6 additions & 1 deletion crates/cpu_timer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#![cfg_attr(target_os = "linux", allow(unexpected_cfgs))]

pub mod timerid;

#[cfg(target_os = "linux")]
use std::sync::Arc;
#[cfg(target_os = "linux")]
use tokio::sync::Mutex;

use anyhow::Error;
use tokio::sync::mpsc;
use tokio::sync::Mutex;

#[cfg(target_os = "linux")]
mod linux {
Expand Down Expand Up @@ -132,6 +135,8 @@ impl CPUTimer {

pub async fn set_channel(&self) -> mpsc::UnboundedReceiver<()> {
let (tx, rx) = mpsc::unbounded_channel();
#[cfg(not(target_os = "linux"))]
let _ = tx;
#[cfg(target_os = "linux")]
{
let mut val = self.cpu_alarm_val.cpu_alarms_tx.lock().await;
Expand Down
2 changes: 1 addition & 1 deletion crates/fs/impl/prefix_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ where
.clone()
.map(Ok)
.or_else(|| self.base_fs.as_ref().map(|it| it.tmp_dir()))
.unwrap_or_else(|| Err(FsError::NotSupported))
.unwrap_or(Err(FsError::NotSupported))
}

fn chdir(&self, path: &Path) -> FsResult<()> {
Expand Down
26 changes: 8 additions & 18 deletions crates/fs/impl/virtual_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ impl VfsEntry {
}
}

fn as_ref(&self) -> VfsEntryRef {
fn as_ref(&self) -> VfsEntryRef<'_> {
match self {
VfsEntry::Dir(dir) => VfsEntryRef::Dir(dir),
VfsEntry::File(file) => VfsEntryRef::File(file),
Expand Down Expand Up @@ -513,10 +513,7 @@ impl VfsRoot {
match entry {
VfsEntryRef::Symlink(symlink) => {
if !seen.insert(path.to_path_buf()) {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"circular symlinks",
));
return Err(std::io::Error::other("circular symlinks"));
}
path = Cow::Owned(symlink.resolve_dest_from_root(&self.root_path));
}
Expand All @@ -530,7 +527,7 @@ impl VfsRoot {
fn find_entry_no_follow(
&self,
path: &Path,
) -> std::io::Result<(PathBuf, VfsEntryRef)> {
) -> std::io::Result<(PathBuf, VfsEntryRef<'_>)> {
self.find_entry_no_follow_inner(path, &mut HashSet::new())
}

Expand Down Expand Up @@ -883,10 +880,9 @@ impl FileBackedVfs {
VfsEntryRef::Symlink(symlink) => {
Ok(symlink.resolve_dest_from_root(&self.fs_root.root_path))
}
VfsEntryRef::Dir(_) | VfsEntryRef::File(_) => Err(std::io::Error::new(
std::io::ErrorKind::Other,
"not a symlink",
)),
VfsEntryRef::Dir(_) | VfsEntryRef::File(_) => {
Err(std::io::Error::other("not a symlink"))
}
}
}

Expand Down Expand Up @@ -928,20 +924,14 @@ impl FileBackedVfs {
match entry {
VfsEntryRef::Dir(dir) => Ok(dir),
VfsEntryRef::Symlink(_) => unreachable!(),
VfsEntryRef::File(_) => Err(std::io::Error::new(
std::io::ErrorKind::Other,
"path is a file",
)),
VfsEntryRef::File(_) => Err(std::io::Error::other("path is a file")),
}
}

pub fn file_entry(&self, path: &Path) -> std::io::Result<&VirtualFile> {
let (_, entry) = self.fs_root.find_entry(path)?;
match entry {
VfsEntryRef::Dir(_) => Err(std::io::Error::new(
std::io::ErrorKind::Other,
"path is a directory",
)),
VfsEntryRef::Dir(_) => Err(std::io::Error::other("path is a directory")),
VfsEntryRef::Symlink(_) => unreachable!(),
VfsEntryRef::File(file) => Ok(file),
}
Expand Down
2 changes: 2 additions & 0 deletions crates/fs/tests/integration_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)] // ctor's implementation checks an internal feature in the caller.

use std::collections::HashMap;
use std::path::Path;
use std::time::Duration;
Expand Down
2 changes: 1 addition & 1 deletion deno/args/lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<'a, T> std::ops::DerefMut for Guard<'a, T> {

impl CliLockfile {
/// Get the inner deno_lockfile::Lockfile.
pub fn lock(&self) -> Guard<Lockfile> {
pub fn lock(&self) -> Guard<'_, Lockfile> {
Guard {
guard: self.lockfile.lock(),
}
Expand Down
6 changes: 2 additions & 4 deletions deno/args/package_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,8 @@ impl NpmInstallDepsProvider {
let mut pkg_pkgs = Vec::with_capacity(
deps.dependencies.len() + deps.dev_dependencies.len(),
);
for (alias, dep) in deps
.dependencies
.into_iter()
.chain(deps.dev_dependencies.into_iter())
for (alias, dep) in
deps.dependencies.into_iter().chain(deps.dev_dependencies)
{
let dep = match dep {
Ok(dep) => dep,
Expand Down
4 changes: 2 additions & 2 deletions deno/cache/deno_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl DenoDir {
}

/// The root directory of the DENO_DIR for display purposes only.
pub fn root_path_for_display(&self) -> std::path::Display {
pub fn root_path_for_display(&self) -> std::path::Display<'_> {
self.root.display()
}

Expand Down Expand Up @@ -184,7 +184,7 @@ pub mod dirs {

pub fn home_dir() -> Option<PathBuf> {
std::env::var_os("HOME")
.and_then(|h| if h.is_empty() { None } else { Some(h) })
.filter(|h| !h.is_empty())
.or_else(|| {
// TODO(bartlomieju):
#[allow(clippy::undocumented_unsafe_blocks)]
Expand Down
2 changes: 1 addition & 1 deletion deno/cache/module_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl ModuleInfoCache {
Ok(())
}

pub fn as_module_analyzer(&self) -> ModuleInfoCacheModuleAnalyzer {
pub fn as_module_analyzer(&self) -> ModuleInfoCacheModuleAnalyzer<'_> {
ModuleInfoCacheModuleAnalyzer {
module_info_cache: self,
parsed_source_cache: &self.parsed_source_cache,
Expand Down
2 changes: 1 addition & 1 deletion deno/cache/parsed_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl ParsedSourceCache {

/// Creates a parser that will reuse a ParsedSource from the store
/// if it exists, or else parse.
pub fn as_capturing_parser(&self) -> CapturingEsParser {
pub fn as_capturing_parser(&self) -> CapturingEsParser<'_> {
CapturingEsParser::new(None, self)
}
}
Expand Down
6 changes: 3 additions & 3 deletions deno/graph_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ impl ModuleGraphBuilder {
)
}

fn create_graph_resolver(&self) -> Result<CliGraphResolver, AnyError> {
fn create_graph_resolver(&self) -> Result<CliGraphResolver<'_>, AnyError> {
let jsx_import_source_config = self
.options
.workspace()
Expand Down Expand Up @@ -1118,8 +1118,8 @@ pub fn format_range_with_colors(referrer: &deno_graph::Range) -> String {
format!(
"{}:{}:{}",
referrer.specifier.as_str(),
&(referrer.range.start.line + 1).to_string(),
&(referrer.range.start.character + 1).to_string()
(referrer.range.start.line + 1),
(referrer.range.start.character + 1)
)
}

Expand Down
2 changes: 2 additions & 0 deletions deno/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::result_large_err)] // Public errors are defined by the pinned Deno crates.

use std::collections::HashMap;
use std::env;
use std::path::Path;
Expand Down
4 changes: 2 additions & 2 deletions deno/npm/byonm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl CliNpmResolver for CliByonmNpmResolver {
Arc::new(self.clone())
}

fn as_inner(&self) -> InnerCliNpmResolverRef {
fn as_inner(&self) -> InnerCliNpmResolverRef<'_> {
InnerCliNpmResolverRef::Byonm(self)
}

Expand All @@ -56,7 +56,7 @@ impl CliNpmResolver for CliByonmNpmResolver {
) -> Result<Cow<'a, Path>, AnyError> {
if !path
.components()
.any(|c| c.as_os_str().to_ascii_lowercase() == "node_modules")
.any(|c| c.as_os_str().eq_ignore_ascii_case("node_modules"))
{
permissions.check_read_path(path).map_err(Into::into)
} else {
Expand Down
2 changes: 1 addition & 1 deletion deno/npm/managed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ impl CliNpmResolver for ManagedCliNpmResolver {
))
}

fn as_inner(&self) -> InnerCliNpmResolverRef {
fn as_inner(&self) -> InnerCliNpmResolverRef<'_> {
InnerCliNpmResolverRef::Managed(self)
}

Expand Down
4 changes: 3 additions & 1 deletion deno/npm/managed/resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ async fn add_package_reqs_to_snapshot(
result
}

fn get_add_pkg_reqs_options(package_reqs: &[PackageReq]) -> AddPkgReqsOptions {
fn get_add_pkg_reqs_options(
package_reqs: &[PackageReq],
) -> AddPkgReqsOptions<'_> {
AddPkgReqsOptions {
package_reqs,
// WARNING: When bumping this version, check if anything needs to be
Expand Down
2 changes: 1 addition & 1 deletion deno/npm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub trait CliNpmResolver: NpmPackageFolderResolver + CliNpmReqResolver {

fn clone_snapshotted(&self) -> Arc<dyn CliNpmResolver>;

fn as_inner(&self) -> InnerCliNpmResolverRef;
fn as_inner(&self) -> InnerCliNpmResolverRef<'_>;

fn as_managed(&self) -> Option<&ManagedCliNpmResolver> {
match self.as_inner() {
Expand Down
2 changes: 1 addition & 1 deletion deno/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl CliResolver {
pub fn create_graph_npm_resolver(
&self,
npm_caching: NpmCachingStrategy,
) -> WorkerCliNpmGraphResolver {
) -> WorkerCliNpmGraphResolver<'_> {
WorkerCliNpmGraphResolver {
npm_resolver: self.npm_resolver.as_ref(),
found_package_json_dep_flag: &self.found_package_json_dep_flag,
Expand Down
1 change: 0 additions & 1 deletion deno/util/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ struct LaxSingleProcessFsFlagInner {

impl Drop for LaxSingleProcessFsFlagInner {
fn drop(&mut self) {
use fs3::FileExt;
// kill the poll thread
self.finished_token.cancel();
// release the file lock
Expand Down
2 changes: 1 addition & 1 deletion deno/util/sync/task_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct TaskQueue {
impl TaskQueue {
/// Acquires a permit where the tasks are executed one at a time
/// and in the order that they were acquired.
pub fn acquire(&self) -> TaskQueuePermitAcquireFuture {
pub fn acquire(&self) -> TaskQueuePermitAcquireFuture<'_> {
TaskQueuePermitAcquireFuture::new(self)
}

Expand Down
Loading
Loading