add() — tailwindcss Function Reference
Architecture documentation for the add() function in gitignore.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD aeb4abcb_3f26_f670_bc29_d72a919dc43b["add()"] 714a3a15_03d5_1e35_b535_53da70bce8eb["gitignore.rs"] aeb4abcb_3f26_f670_bc29_d72a919dc43b -->|defined in| 714a3a15_03d5_1e35_b535_53da70bce8eb 2364e0a6_e483_920e_1924_cac7fdeeb1e5["new()"] 2364e0a6_e483_920e_1924_cac7fdeeb1e5 -->|calls| aeb4abcb_3f26_f670_bc29_d72a919dc43b acc4becc_5fd3_4342_5416_06a04930a4c6["build_global()"] acc4becc_5fd3_4342_5416_06a04930a4c6 -->|calls| aeb4abcb_3f26_f670_bc29_d72a919dc43b e13a7ddc_3ca6_4a8a_8782_4f52ab015f25["add_line()"] e13a7ddc_3ca6_4a8a_8782_4f52ab015f25 -->|calls| aeb4abcb_3f26_f670_bc29_d72a919dc43b e13a7ddc_3ca6_4a8a_8782_4f52ab015f25["add_line()"] aeb4abcb_3f26_f670_bc29_d72a919dc43b -->|calls| e13a7ddc_3ca6_4a8a_8782_4f52ab015f25 style aeb4abcb_3f26_f670_bc29_d72a919dc43b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/ignore/src/gitignore.rs lines 393–425
pub fn add<P: AsRef<Path>>(&mut self, path: P) -> Option<Error> {
let path = path.as_ref();
let file = match File::open(path) {
Err(err) => return Some(Error::Io(err).with_path(path)),
Ok(file) => file,
};
log::debug!("opened gitignore file: {}", path.display());
let rdr = BufReader::new(file);
let mut errs = PartialErrorBuilder::default();
for (i, line) in rdr.lines().enumerate() {
let lineno = (i + 1) as u64;
let line = match line {
Ok(line) => line,
Err(err) => {
errs.push(Error::Io(err).tagged(path, lineno));
break;
}
};
// Match Git's handling of .gitignore files that begin with the Unicode BOM
const UTF8_BOM: &str = "\u{feff}";
let line = if i == 0 {
line.trim_start_matches(UTF8_BOM)
} else {
&line
};
if let Err(err) = self.add_line(Some(path.to_path_buf()), &line) {
errs.push(err.tagged(path, lineno));
}
}
errs.into_error_option()
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does add() do?
add() is a function in the tailwindcss codebase, defined in crates/ignore/src/gitignore.rs.
Where is add() defined?
add() is defined in crates/ignore/src/gitignore.rs at line 393.
What does add() call?
add() calls 1 function(s): add_line.
What calls add()?
add() is called by 3 function(s): add_line, build_global, new.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free