MCPcopy Create free account
hub / github.com/apache/datafusion / substitute_tilde

Function substitute_tilde

datafusion-cli/src/catalog.rs:208–217  ·  view source on GitHub ↗
(cur: String)

Source from the content-addressed store, hash-verified

206}
207
208pub fn substitute_tilde(cur: String) -> String {
209 if let Some(usr_dir_path) = home_dir()
210 && let Some(usr_dir) = usr_dir_path.to_str()
211 && cur.starts_with('~')
212 && !usr_dir.is_empty()
213 {
214 return cur.replacen('~', usr_dir, 1);
215 }
216 cur
217}
218#[cfg(test)]
219mod tests {
220 use std::{env, vec};

Callers 2

tableMethod · 0.85
test_substitute_tildeFunction · 0.85

Calls 2

replacenMethod · 0.80
is_emptyMethod · 0.45

Tested by 1

test_substitute_tildeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…