add() — tailwindcss Function Reference
Architecture documentation for the add() function in gitignore.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD ae012ab6_9cfc_afd5_a99d_c076b3ac0f7c["add()"] 4070cc0c_7b7d_154a_4c5a_53a488f619d9["new()"] 4070cc0c_7b7d_154a_4c5a_53a488f619d9 -->|calls| ae012ab6_9cfc_afd5_a99d_c076b3ac0f7c 4a40236e_7852_7d42_0756_529c9da2f5ba["build_global()"] 4a40236e_7852_7d42_0756_529c9da2f5ba -->|calls| ae012ab6_9cfc_afd5_a99d_c076b3ac0f7c 7d4fc0a8_2482_5c00_9ba0_171b0cafaa7a["add_line()"] 7d4fc0a8_2482_5c00_9ba0_171b0cafaa7a -->|calls| ae012ab6_9cfc_afd5_a99d_c076b3ac0f7c 7d4fc0a8_2482_5c00_9ba0_171b0cafaa7a["add_line()"] ae012ab6_9cfc_afd5_a99d_c076b3ac0f7c -->|calls| 7d4fc0a8_2482_5c00_9ba0_171b0cafaa7a style ae012ab6_9cfc_afd5_a99d_c076b3ac0f7c 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
Calls
Called By
Source
Frequently Asked Questions
What does add() do?
add() is a function in the tailwindcss codebase.
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