Skip to content

Commit

Permalink
Make dinopkg-package-json work without tokio
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyfallWasTaken committed Jul 15, 2024
1 parent b593a5a commit 805f21f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/dinopkg-package-json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions crates/dinopkg-package-json/src/util.rs
Original file line number Diff line number Diff line change
@@ -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");
Expand Down

0 comments on commit 805f21f

Please sign in to comment.