fnmatch_regex2/
lib.rs

1#![warn(missing_docs)]
2//! Various fnmatch- and glob-style handling.
3//!
4//! For the present, this crate only defines a conversion function from
5//! an fnmatch-style glob pattern to a regular expression.
6//!
7//! See the [`glob`] module for more information on
8//! the [`glob_to_regex`] function's usage.
9
10/*
11 * Copyright (c) 2021, 2022  Peter Pentchev <roam@ringlet.net>
12 * All rights reserved.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 *    notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 *    notice, this list of conditions and the following disclaimer in the
21 *    documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35// Activate most of the clippy::restriction lints that we have come across...
36#![warn(clippy::exhaustive_enums)]
37#![warn(clippy::missing_docs_in_private_items)]
38#![warn(clippy::missing_inline_in_public_items)]
39#![warn(clippy::panic)]
40#![warn(clippy::pattern_type_mismatch)]
41#![warn(clippy::shadow_reuse)]
42#![warn(clippy::shadow_same)]
43#![warn(clippy::str_to_string)]
44// ...except for these ones.
45#![allow(clippy::implicit_return)]
46// Activate most of the clippy::pedantic lints that we have come across...
47#![warn(clippy::explicit_into_iter_loop)]
48#![warn(clippy::match_bool)]
49#![warn(clippy::missing_errors_doc)]
50#![warn(clippy::panic_in_result_fn)]
51#![warn(clippy::too_many_lines)]
52#![warn(clippy::unnecessary_wraps)]
53#![warn(clippy::unreachable)]
54// ...except for these ones.
55#![allow(clippy::module_name_repetitions)]
56// Activate most of the clippy::nursery lints that we have come across...
57#![warn(clippy::branches_sharing_code)]
58#![warn(clippy::missing_const_for_fn)]
59
60pub mod error;
61pub mod glob;
62
63pub use glob::{glob_to_regex, glob_to_regex_ext};
64
65#[cfg(test)]
66pub mod tests;