diff options
author | Erin Power <xampprocky@gmail.com> | 2020-02-13 17:02:59 +0100 |
---|---|---|
committer | Erin Power <xampprocky@gmail.com> | 2020-02-13 17:03:40 +0100 |
commit | 38ef393c9370e1af60e6ce3993b35c1d644bbc8f (patch) | |
tree | a82d3fa79d5e6140d133bc2e9cb7c7d46ec56fdb | |
parent | 4cdc98a76b3facb0a2469332c76995cbaf8e81f8 (diff) |
Fixed documentation example
-rw-r--r-- | src/lib.rs | 24 |
1 files changed, 10 insertions, 14 deletions
@@ -13,28 +13,24 @@ //! and all subdirectories. //! //! ```no_run -//! extern crate tokei; -//! //! use std::collections::BTreeMap; //! use std::fs::File; //! use std::io::Read; //! //! use tokei::{Config, Languages, LanguageType}; //! -//! fn main() { -//! // The paths to search. Accepts absolute, relative, and glob paths. -//! let paths = &["src", "tests"]; -//! // Exclude any path that contains any of these strings. -//! let excluded = &["target"]; -//! // `Config` allows you to configure what is searched and counted. -//! let config = Config::default(); +//! // The paths to search. Accepts absolute, relative, and glob paths. +//! let paths = &["src", "tests"]; +//! // Exclude any path that contains any of these strings. +//! let excluded = &["target"]; +//! // `Config` allows you to configure what is searched and counted. +//! let config = Config::default(); //! -//! let mut languages = Languages::new(); -//! languages.get_statistics(paths, excluded, &config); -//! let rust = &languages[&LanguageType::Rust]; +//! let mut languages = Languages::new(); +//! languages.get_statistics(paths, excluded, &config); +//! let rust = &languages[&LanguageType::Rust]; //! -//! println!("Lines of code: {}", rust.code); -//! } +//! println!("Lines of code: {}", rust.code); //! ``` #![deny( |