Julio Biason
1 year ago
4 changed files with 30 additions and 0 deletions
@ -0,0 +1,7 @@ |
|||||||
|
# This file is automatically @generated by Cargo. |
||||||
|
# It is not intended for manual editing. |
||||||
|
version = 3 |
||||||
|
|
||||||
|
[[package]] |
||||||
|
name = "canonicalizetest" |
||||||
|
version = "0.1.0" |
@ -0,0 +1,8 @@ |
|||||||
|
[package] |
||||||
|
name = "canonicalizetest" |
||||||
|
version = "0.1.0" |
||||||
|
edition = "2021" |
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html |
||||||
|
|
||||||
|
[dependencies] |
@ -0,0 +1,3 @@ |
|||||||
|
# CanonicalizeTest |
||||||
|
|
||||||
|
Playing a bit with `Path::canonicalize`. |
@ -0,0 +1,12 @@ |
|||||||
|
use std::path::Path; |
||||||
|
|
||||||
|
fn main() { |
||||||
|
let path = Path::new("."); |
||||||
|
println!("{:?}", path.canonicalize()); |
||||||
|
|
||||||
|
let path = Path::new(".").join(".."); |
||||||
|
println!("{:?}", path.canonicalize()); |
||||||
|
|
||||||
|
let path = Path::new(".").join("not-here"); |
||||||
|
println!("{:?}", path.canonicalize()); |
||||||
|
} |
Loading…
Reference in new issue