From 5757cb43f55e1f617962e34c7a872806d92a5b66 Mon Sep 17 00:00:00 2001 From: Cong-Cong Date: Tue, 20 Aug 2024 12:32:54 +0800 Subject: [PATCH] chore: fomat --- src/lib.rs | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5f3972c..b4e4972 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,22 +37,17 @@ //! For detailed usage and API reference, refer to the specific function and struct documentation. //! //! For any issues or contributions, please visit the [GitHub repository](https://github.com/shulaoda/fast-glob). -//! -/// Performs glob pattern matching for a simple glob pattern. -/// -/// Returns `true` if `glob` matches `path`, `false` otherwise. -/// -/// # Example -/// -/// ``` -/// use fast_glob::glob_match; -/// -/// let glob = "**/*.txt"; -/// let path = "file.txt"; -/// -/// assert!(glob_match(glob, path)); -/// ``` +/** + * The following code is modified based on + * https://github.com/devongovett/glob-match/blob/d5a6c67/src/lib.rs + * + * MIT Licensed + * Copyright (c) 2023 Devon Govett + * https://github.com/devongovett/glob-match/tree/main/LICENSE + */ +use std::path::is_separator; + pub fn glob_match(glob: &str, path: &str) -> bool { let glob = glob.as_bytes(); let path = path.as_bytes(); @@ -73,16 +68,6 @@ pub fn glob_match(glob: &str, path: &str) -> bool { } } -/** - * The following code is modified based on - * https://github.com/devongovett/glob-match/blob/d5a6c67/src/lib.rs - * - * MIT Licensed - * Copyright (c) 2023 Devon Govett - * https://github.com/devongovett/glob-match/tree/main/LICENSE - */ -use std::path::is_separator; - #[derive(Clone, Copy, Debug, Default)] pub(crate) struct State { pub(crate) path_index: usize,