add() — tailwindcss Function Reference
Architecture documentation for the add() function in gitignore.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD f95b3cad_268d_6201_5f31_b8ae0f47ef4a["add()"] 61377720_4557_3c63_7653_b6ed73e2face["gitignore.rs"] f95b3cad_268d_6201_5f31_b8ae0f47ef4a -->|defined in| 61377720_4557_3c63_7653_b6ed73e2face cb2f2846_8ee9_4e71_0e41_554bf62917ad["new()"] cb2f2846_8ee9_4e71_0e41_554bf62917ad -->|calls| f95b3cad_268d_6201_5f31_b8ae0f47ef4a 754854aa_e099_3833_b439_120751057d45["build_global()"] 754854aa_e099_3833_b439_120751057d45 -->|calls| f95b3cad_268d_6201_5f31_b8ae0f47ef4a 253ea400_e0d4_304c_157c_a6dad80fd874["add_line()"] 253ea400_e0d4_304c_157c_a6dad80fd874 -->|calls| f95b3cad_268d_6201_5f31_b8ae0f47ef4a 253ea400_e0d4_304c_157c_a6dad80fd874["add_line()"] f95b3cad_268d_6201_5f31_b8ae0f47ef4a -->|calls| 253ea400_e0d4_304c_157c_a6dad80fd874 style f95b3cad_268d_6201_5f31_b8ae0f47ef4a 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