add() — tailwindcss Function Reference
Architecture documentation for the add() function in gitignore.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD e58274c7_3647_b80e_0fb2_dc3c49dd0e95["add()"] bc289d7f_95ef_0ff2_e647_2bcb110d3196["new()"] bc289d7f_95ef_0ff2_e647_2bcb110d3196 -->|calls| e58274c7_3647_b80e_0fb2_dc3c49dd0e95 de77b36f_3db5_ca54_4bd7_e5f41c58192f["build_global()"] de77b36f_3db5_ca54_4bd7_e5f41c58192f -->|calls| e58274c7_3647_b80e_0fb2_dc3c49dd0e95 beacadb8_c4b1_66be_a831_13b5d839d638["add_line()"] beacadb8_c4b1_66be_a831_13b5d839d638 -->|calls| e58274c7_3647_b80e_0fb2_dc3c49dd0e95 beacadb8_c4b1_66be_a831_13b5d839d638["add_line()"] e58274c7_3647_b80e_0fb2_dc3c49dd0e95 -->|calls| beacadb8_c4b1_66be_a831_13b5d839d638 style e58274c7_3647_b80e_0fb2_dc3c49dd0e95 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