R Under development (unstable) (2023-08-05 r84874 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > print_cargo <- function(){ + home <- Sys.getenv(ifelse(.Platform$OS.type == 'windows', 'USERPROFILE', 'HOME')) + cargodir <- file.path(home, '.cargo', 'bin') + Sys.setenv(PATH = paste(cargodir, Sys.getenv('PATH'), sep = .Platform$path.sep)) + cargo <- Sys.which('cargo') + if(nchar(cargo)){ + cat("Found cargo in:", cargo, "\n") + system("cargo --version", wait = TRUE) + } else { + cat("Cargo not found on the path\n") + } + invisible() + } > print_cargo() Found cargo in: C:\Users\CRAN\CARGO~1\bin\cargo.exe cargo 1.69.0 (6e9a83356 2023-04-12) > > proc.time() user system elapsed 0.14 0.04 0.23