Benign crates 1,752,457 installs Download

ra_ap_vfs-notify 0.0.349

“Implementation of `loader::Handle` for rust-analyzer.”

Large registry install base (10k+ downloads)Package is at least one year old
SHA-25690afcd6bd2498ebb96189c7d353b6b1d157c4dd512e7ce9005c37c2df4a78a29

Evidence

English function-word token "the" lines 1–5
1:15… ntation of `loader::Handle`, based on `walkdir` and `notify`.
2//!
3//! The file watching bits here are untested and quite probably buggy. For this
4//! reason, by default we don't watch files and rely on editor's file watching
5//! capabilities …
imports std::fs lines 8–32
8:13… o, and we can reduce this to trivial glue code.
9
10use std::{
11 fs,
12 path::{Component, Path},
13 sync::atomic::AtomicUsize,
14};
15
16use crossbeam_channel::{Receiver, Sender, select, unbounded};
17use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher, event::AccessKind};
18use paths::{AbsPath, AbsPathBuf, Utf8PathBuf};
19use rayon::iter::{IndexedParallelIterator as _, IntoParallelIterator as _, ParallelIterator};
20use rustc_hash::FxHashSet;
21use vfs::loader::{self, LoadingProgress};
22use walkdir::WalkDir;
23
24#[derive(Debug)]
25pub struct NotifyHandle {
26 // Relative order of fields below is significant.
27 sender: Sender<Message>,
28 _thread: stdx::thread::JoinHandle,
29}
30
31#[derive(Debug)]
32en …
Rust while loop lines 99–101
99:10… n(mut self, inbox: Receiver<Message>) {
100 while let Some(event) = self.next_event(&inbox) {
101 tracing::debug!(?event, "vfs-notify even …
Rust materializes an iterator with .collect() lines 214–218
214:12… })
215 .collect();
216
217 let mut saw_new_file = false;
218 for abs_path …
Rust walkdir directory iterator lines 301–306
301:43… e());
302 let walkdir =
303 WalkDir::new(root).follow_links(true).into_iter().filter_entry(|entry| {
304 if !entry.file_type().is_dir() {
305 return true;
306 …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.