conspire/io/netcdf/from/mod.rs
1use crate::io::netcdf::NetCDF;
2use std::{ffi::NulError, path::Path};
3
4impl TryFrom<&Path> for NetCDF {
5 type Error = NulError;
6 fn try_from(path: &Path) -> Result<Self, Self::Error> {
7 let path = path
8 .to_str()
9 .expect("Might need a new error type to handle errors properly");
10 let mut netcdf = Self::create(path)?;
11 netcdf.global();
12 Ok(netcdf)
13 }
14}