MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / toml_path

Function toml_path

atomic-agent/src/integrations/install.rs:329–331  ·  view source on GitHub ↗

Render a filesystem path for embedding in a TOML basic (double-quoted) string. On Windows, paths contain backslashes, which TOML treats as escape-sequence introducers (`\Users` → invalid unicode escape), so they must be doubled.

(path: &Path)

Source from the content-addressed store, hash-verified

327 /// escape-sequence introducers (`\Users` → invalid unicode escape), so
328 /// they must be doubled.
329 fn toml_path(path: &Path) -> String {
330 path.display().to_string().replace('\\', "\\\\")
331 }
332
333 /// Build a fake package in a tempdir: manifest + two files + a settings
334 /// manifest. Returns (pkg_dir, dst_dir) tempdirs.

Calls 2

displayMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected