-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy path.clippy.toml
More file actions
27 lines (24 loc) · 2.09 KB
/
.clippy.toml
File metadata and controls
27 lines (24 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
avoid-breaking-exported-api = false
disallowed-methods = [
{ path = "str::to_ascii_lowercase", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_to_ascii_lowercase` instead." },
{ path = "str::to_ascii_uppercase", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_to_ascii_uppercase` instead." },
{ path = "str::to_lowercase", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_to_lowercase` instead." },
{ path = "str::to_uppercase", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_to_uppercase` instead." },
{ path = "str::replace", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_replace` instead." },
{ path = "str::replacen", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_replacen` instead." },
{ path = "std::env::current_dir", reason = "To get an `AbsolutePathBuf`, Use `vite_path::current_dir` instead." },
]
disallowed-types = [
{ path = "std::collections::HashMap", reason = "Use `rustc_hash::FxHashMap` instead, which is typically faster." },
{ path = "std::collections::HashSet", reason = "Use `rustc_hash::FxHashSet` instead, which is typically faster." },
{ path = "std::path::Path", reason = "Use `vite_path::RelativePath` or `vite_path::AbsolutePath` instead" },
{ path = "std::path::PathBuf", reason = "Use `vite_path::RelativePathBuf` or `vite_path::AbsolutePathBuf` instead" },
{ path = "std::string::String", reason = "Use `vite_str::Str` for small strings. For large strings, prefer `Box/Rc/Arc<str>` if mutation is not needed." },
]
disallowed-macros = [
{ path = "std::format", reason = "Use `vite_str::format` for small strings." },
{ path = "std::println", reason = "Use `vite_shared::output` functions (`info`, `note`, `success`) instead." },
{ path = "std::print", reason = "Use `vite_shared::output` functions (`info`, `note`, `success`) instead." },
{ path = "std::eprintln", reason = "Use `vite_shared::output` functions (`warn`, `error`) instead." },
{ path = "std::eprint", reason = "Use `vite_shared::output` functions (`warn`, `error`) instead." },
]