Benign cargo Download

lib.rs

Contains an unbounded block loopReferences top-level /root path
SHA-256b514d32813c8053336fa887cf256b40440d1008eb156ab3b979fd9899bf0e407

Evidence

imports std::fs lines 20–47
20:64… e libc
21//! `glob`/`fnmatch` functions.
22
23#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
24 html_favicon_url = "http://www.rust-lang.org/favicon.ico",
25 html_root_url = "http://doc.rust-lang.org/glob/")]
26#![cfg_attr(test, deny(warnings))]
27#![cfg_attr(all(test, windows), feature(std_misc))]
28#![feature(path, io, core, collections, unicode, fs, os)]
29
30use std::ascii::AsciiExt;
31use std::cell::Cell;
32use std::cmp;
33use std::fmt;
34use std::fs;
35use std::io::prelude::*;
36use std::io;
37use std::path::{self, Path, PathBuf, Component};
38
39use PatternToken::{Char, AnyChar, AnySequence, AnyRecursiveSequence, AnyWithin};
40use PatternToken::AnyExcept;
41use CharSpecifier::{SingleChar, CharRange};
42use MatchResult::{Match, SubPatternDoesntMatch, EntirePatternDoesntMatch};
43
44/// An iterator that yields `Path`s from the filesystem that match a particular
45/// pattern.
46///
47/// Note …
References the /media removable-mount root lines 82–91
82:52… :
83///
84/// ```rust
85/// use glob::glob;
86///
87/// for entry in glob("/media/pictures/*.jpg").unwrap() {
88/// match entry {
89/// Ok(path) => println!("{:?}", path.display()),
90///
91/// // i …
Contains an unbounded block loop lines 155–161
155:53… () }
156
157 let mut components = Path::new(pattern).components();
158 loop {
159 match components.peek() {
160 Some(Component::Prefix { .. }) |
161 Some(Component::RootDir) => { compon …
imports super::glob lines 896–910
⋯4 lines
900}
901
902#[cfg(test)]
903mod test {
904 use std::path::Path;
905 use super::{glob, Pattern, MatchOptions};
906
907 #[test]
908 fn test_wildcard_errors() {
909 assert!(Pattern::new("a/**b").unwrap_err().pos == 4);
910 assert!(Pattern::new("a/b …
References top-level /root path lines 931–936
931:42… rap().pos == 3);
932 }
933
934 // this test assumes that there is a /root directory and that
935 // the user running this test is not root or otherwise doesn't
936 // have permission to read its content …

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.