Browse Source

Playing a bit with Path::canonicalize

master
Julio Biason 1 year ago
parent
commit
99eaae279b
  1. 7
      canonicalizetest/Cargo.lock
  2. 8
      canonicalizetest/Cargo.toml
  3. 3
      canonicalizetest/README.md
  4. 12
      canonicalizetest/src/main.rs

7
canonicalizetest/Cargo.lock generated

@ -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"

8
canonicalizetest/Cargo.toml

@ -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]

3
canonicalizetest/README.md

@ -0,0 +1,3 @@
# CanonicalizeTest
Playing a bit with `Path::canonicalize`.

12
canonicalizetest/src/main.rs

@ -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…
Cancel
Save