Make dinopkg-package-json work without tokio

This commit is contained in:
SkyfallWasTaken 2024-07-15 22:34:26 +01:00
parent b593a5af70
commit 805f21f575
2 changed files with 4 additions and 2 deletions

View file

@ -30,10 +30,12 @@ pub struct PackageJson {
// serde :/
#[allow(clippy::trivially_copy_pass_by_ref)]
#[inline(always)]
fn is_false(value: &bool) -> bool {
!value
}
#[inline(always)]
fn default_as_false() -> bool {
false
}

View file

@ -1,12 +1,12 @@
use std::env;
use std::path::PathBuf;
use tokio::fs;
use crate::Error;
#[cfg(feature = "tokio")]
pub async fn find_package_json(max_attempts: usize) -> Result<Option<PathBuf>, Error> {
use tokio::fs;
let mut current_dir = env::current_dir()?;
for _ in 0..max_attempts {
let package_json_path = current_dir.join("package.json");