<commit_before>macro_rules! err {
    ($text:expr, $kind:expr) => {
        return Err(Error::new($kind, $text));
    };

    ($text:expr) => {
        err!($text, ErrorKind::Other)
    };
}

/// The error type for fs_extra operations with files and folder.
pub mod error;
/// This module include extra methods for works with files.
///
/// One of the distinguishing features is receipt information
/// about process work with files.
///
/// # Example
/// ```rust,ignore
/// use std::path::Path;
/// use std::{thread, time};
/// use std::sync::mpsc::{self, TryRecvError};
///
/// extern crate fs_extra;
/// use fs_extra::file::*;
/// use fs_extra::error::*;
///
/// fn example_copy() -> Result<()> {
///     let path_from = Path::new("./temp");
///     let path_to = path_from.join("out");
///     let test_file = (path_from.join("test_file.txt"), path_to.join("test_file.txt"));
///
///
///     fs_extra::dir::create_all(&path_from, true)?;
///     fs_extra::dir::create_all(&path_to, true)?;
///
///     write_all(&test_file.0, "test_data")?;
///     assert!(test_file.0.exists());
///     assert!(!test_file.1.exists());
///
///
///     let options = CopyOptions {
///         buffer_size: 1,
///         ..Default::default()
///     }
///     let (tx, rx) = mpsc::channel();
///     thread::spawn(move || {
///         let handler = |process_info: TransitProcess| {
///             tx.send(process_info).unwrap();
///             thread::sleep(time::Duration::from_millis(500));
///         };
///         copy_with_progress(&test_file.0, &test_file.1, &options, handler).unwrap();
///         assert!(test_file.0.exists());
///         assert!(test_file.1.exists());
///
///     });
///     loop {
///         match rx.try_recv() {
///             Ok(process_info) => {
///                 println!("{} of {} bytes",
///                          process_info.copied_bytes,
///                          process_info.total_bytes);
///             }
///             Err(TryRecvError::Disconnected) => {
///                 println!("finished");
///                 break;
///             }
///             Err(TryRecvError::Empty) => {}
///         }
///     }
///     Ok(())
///
/// }
///
///
/// fn main() {
///     example_copy();
///
///
/// ```
pub mod file;

/// This module include extra methods for works with directories.
///
/// One of the distinguishing features is receipt information
/// about process work with directories and recursion operations.
///
/// # Example
/// ```rust,ignore
/// use std::path::Path;
/// use std::{thread, time};
/// use std::sync::mpsc::{self, TryRecvError};
///
/// extern crate fs_extra;
/// use fs_extra::dir::*;
/// use fs_extra::error::*;
///
/// fn example_copy() -> Result<()> {
///
///     let path_from = Path::new("./temp");
///     let path_to = path_from.join("out");
///     let test_folder = path_from.join("test_folder");
///     let dir = test_folder.join("dir");
///     let sub = dir.join("sub");
///     let file1 = dir.join("file1.txt");
///     let file2 = sub.join("file2.txt");
///
///     create_all(&sub, true)?;<commit_msg>Fixed doc warning for incomplete Rust code<commit_after>macro_rules! err {
    ($text:expr, $kind:expr) => {
        return Err(Error::new($kind, $text));
    };

    ($text:expr) => {
        err!($text, ErrorKind::Other)
    };
}

/// The error type for fs_extra operations with files and folder.
pub mod error;
/// This module include extra methods for works with files.
///
/// One of the distinguishing features is receipt information
/// about process work with files.
///
/// # Example
/// ```rust,ignore
/// use std::path::Path;
/// use std::{thread, time};
/// use std::sync::mpsc::{self, TryRecvError};
///
/// extern crate fs_extra;
/// use fs_extra::file::*;
/// use fs_extra::error::*;
///
/// fn example_copy() -> Result<()> {
///     let path_from = Path::new("./temp");
///     let path_to = path_from.join("out");
///     let test_file = (path_from.join("test_file.txt"), path_to.join("test_file.txt"));
///
///
///     fs_extra::dir::create_all(&path_from, true)?;
///     fs_extra::dir::create_all(&path_to, true)?;
///
///     write_all(&test_file.0, "test_data")?;
///     assert!(test_file.0.exists());
///     assert!(!test_file.1.exists());
///
///
///     let options = CopyOptions {
///         buffer_size: 1,
///         ..Default::default()
///     }
///     let (tx, rx) = mpsc::channel();
///     thread::spawn(move || {
///         let handler = |process_info: TransitProcess| {
///             tx.send(process_info).unwrap();
///             thread::sleep(time::Duration::from_millis(500));
///         };
///         copy_with_progress(&test_file.0, &test_file.1, &options, handler).unwrap();
///         assert!(test_file.0.exists());
///         assert!(test_file.1.exists());
///
///     });
///     loop {
///         match rx.try_recv() {
///             Ok(process_info) => {
///                 println!("{} of {} bytes",
///                          process_info.copied_bytes,
///                          process_info.total_bytes);
///             }
///             Err(TryRecvError::Disconnected) => {
///                 println!("finished");
///                 break;
///             }
///             Err(TryRecvError::Empty) => {}
///         }
///     }
///     Ok(())
///
/// }
///
///
/// fn main() {
///     example_copy();
/// }
///
/// ```
pub mod file;

/// This module include extra methods for works with directories.
///
/// One of the distinguishing features is receipt information
/// about process work with directories and recursion operations.
///
/// # Example
/// ```rust,ignore
/// use std::path::Path;
/// use std::{thread, time};
/// use std::sync::mpsc::{self, TryRecvError};
///
/// extern crate fs_extra;
/// use fs_extra::dir::*;
/// use fs_extra::error::*;
///
/// fn example_copy() -> Result<()> {
///
///     let path_from = Path::new("./temp");
///     let path_to = path_from.join("out");
///     let test_folder = path_from.join("test_folder");
///     let dir = test_folder.join("dir");
///     let sub = dir.join("sub");
///     let file1 = dir.join("file1.txt");
///     let file2 = sub.join("file2.txt");
///
///     create_all(&sub, true)?;
{'fraction_non_alphanumeric': 0.2317838185620074, 'fraction_numerical': 0.004825478526620556, 'mean_word_length': 1.9357884796978282, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2910030', 'n_tokens_mistral': 1946, 'n_tokens_neox': 1942, 'n_words': 393}