mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-15 19:30:38 +08:00
Exchange From for TryFrom for PathBuf and Home
The `From` implementation would allow someone to create a `Home` in an incorrect fashion, for example the path is not canonical. Exchange `From` for a `TryFrom` implementation. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
committed by
Alexis Sellier
parent
3cf1accddd
commit
a3f8a0b524
@@ -1,3 +1,4 @@
|
||||
use std::convert::TryInto as _;
|
||||
use std::path::Path;
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
@@ -81,7 +82,8 @@ pub fn seed(dir: &Path) -> Context {
|
||||
.unwrap();
|
||||
|
||||
// eq. rad auth
|
||||
let profile = radicle::Profile::init(rad_home.into(), PASSWORD.to_owned()).unwrap();
|
||||
let profile =
|
||||
radicle::Profile::init(rad_home.try_into().unwrap(), PASSWORD.to_owned()).unwrap();
|
||||
|
||||
// rad init
|
||||
rad_init::init(
|
||||
|
||||
Reference in New Issue
Block a user