1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-07 17:03:01 +03:00

Switch to camino's Utf8Path* instead of std::path::Path*

This commit is contained in:
Quentin Gliech
2022-11-18 18:50:11 +01:00
parent c76a1dd2e7
commit a86798d2b3
21 changed files with 99 additions and 74 deletions

View File

@@ -12,9 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::path::PathBuf;
use anyhow::Context;
use camino::Utf8PathBuf;
use clap::Parser;
use mas_config::ConfigurationSection;
@@ -50,7 +49,7 @@ enum Subcommand {
pub struct Options {
/// Path to the configuration file
#[arg(short, long, global = true, action = clap::ArgAction::Append)]
config: Vec<PathBuf>,
config: Vec<Utf8PathBuf>,
#[command(subcommand)]
subcommand: Option<Subcommand>,
@@ -78,7 +77,7 @@ impl Options {
.unwrap_or_else(|_| "config.yaml".to_owned())
// Split the file list on `:`
.split(':')
.map(PathBuf::from)
.map(Utf8PathBuf::from)
.collect()
} else {
self.config.clone()

View File

@@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::path::PathBuf;
use camino::Utf8PathBuf;
use clap::Parser;
use mas_storage::Clock;
use mas_templates::Templates;
@@ -29,7 +28,7 @@ enum Subcommand {
/// Save the builtin templates to a folder
Save {
/// Where the templates should be saved
path: PathBuf,
path: Utf8PathBuf,
/// Overwrite existing template files
#[arg(long)]