Benign crates 853,117 installs Download

typst-kit 0.12.0-rc1

“Common utilities for Typst tooling.”

Contains an unbounded block loopimports std::fs
SHA-25670e37da380d860505789cb74575e8c0ca89ee420cea8756eba5f3000429f9f2c
MaleculeH₂(Cm₂F)

Evidence

imports std::fs package.rs · lines 1–18
1//! Download and unpack packages and package indices.
2
3use std::fs;
4use std::path::{Path, PathBuf};
5
6use ecow::eco_format;
7use once_cell::sync::OnceCell;
8use typst::diag::{bail, PackageError, PackageResult, StrResult};
9use typst::syntax::package::{
10 PackageInfo, PackageSpec, PackageVersion, VersionlessPackageSpec,
11};
12
13use crate::download::{Downloader, Progress};
14
15/// The default Typst registry.
16pub const DEFAULT_REGISTRY: &str = "https://packages.typst.org";
17
18/// The def …
Enumerates a directory with Rust std::fs package.rs · lines 118–123
118:23… ge_path
119 .iter()
120 .flat_map(|dir| std::fs::read_dir(dir.join(&subdir)).ok())
121 .flatten()
122 .filter_map(|entry| entry.ok())
123 .map(|entry| …
Uses the Rust ureq HTTP client package.rs · lines 137–142
137:61… index: {err}")
138 }),
139 Err(ureq::Error::Status(404, _)) => {
140 bail!("failed to fetch package index (not found)")
141 }
142 …
imports ureq::Response download.rs · lines 3–28
3:45… master/src/cli/download_tracker.rs
4
5//! Helpers for making various web requests with status reporting. These are
6//! primarily used for communicating with package registries.
7
8use std::collections::VecDeque;
9use std::fmt::Debug;
10use std::io::{self, ErrorKind, Read};
11use std::path::PathBuf;
12use std::sync::Arc;
13use std::time::{Duration, Instant};
14
15use ecow::EcoString;
16use native_tls::{Certificate, TlsConnector};
17use once_cell::sync::OnceCell;
18use ureq::Response;
19
20/// Manages progress reporting for downloads.
⋯8 lines
Rust configures a ureq agent download.rs · lines 110–115
110:42… Result<ureq::Response, ureq::Error> {
111 let mut builder = ureq::AgentBuilder::new();
112 let mut tls = TlsConnector::builder();
113
114 // Set user agent.
115 builder = builder.user_agent(&self.u …

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.