mirror of
https://codeberg.org/icewind/nextcloud-config-parser.git
synced 2026-06-03 08:34:13 +02:00
update dependencies
This commit is contained in:
parent
b388c2ccf0
commit
96954dc116
4 changed files with 15 additions and 16 deletions
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
|
|
@ -58,7 +58,7 @@ jobs:
|
|||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: 1.45
|
||||
toolchain: 1.54
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/cargo@v1
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "nextcloud-config-parser"
|
||||
description = "Rust parser for nextcloud config files"
|
||||
version = "0.4.2"
|
||||
version = "0.5.0"
|
||||
authors = ["Robin Appelman <robin@icewind.nl>"]
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
|
@ -11,14 +11,14 @@ documentation = "https://docs.rs/nextcloud-config-parser"
|
|||
[dependencies]
|
||||
redis = { version = "0.21", optional = true }
|
||||
thiserror = "1"
|
||||
php-literal-parser = { version = "0.3", default-features = false }
|
||||
php-literal-parser = "0.4"
|
||||
sqlx = { version = "0.5", features = ["any", "mysql", "sqlite", "postgres"], optional = true }
|
||||
miette = "3"
|
||||
|
||||
[dev-dependencies]
|
||||
sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "any", "mysql", "sqlite", "postgres"] }
|
||||
miette = { version = "3", features = ["fancy"] }
|
||||
|
||||
[features]
|
||||
default = ["span-colors"]
|
||||
span-colors = ["php-literal-parser/colors"]
|
||||
db-sqlx = ["sqlx"]
|
||||
redis-connect = ["redis"]
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
use miette::Result;
|
||||
use nextcloud_config_parser::parse;
|
||||
|
||||
fn main() {
|
||||
let config = match parse("tests/configs/basic.php") {
|
||||
Ok(config) => config,
|
||||
Err(err) => {
|
||||
eprintln!("{}", err);
|
||||
return;
|
||||
}
|
||||
};
|
||||
fn main() -> Result<()> {
|
||||
let config = parse("tests/configs/basic.php")?;
|
||||
dbg!(config);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
mod nc;
|
||||
|
||||
use miette::Diagnostic;
|
||||
#[cfg(feature = "redis-connect")]
|
||||
use redis::{ConnectionAddr, ConnectionInfo};
|
||||
#[cfg(feature = "redis-connect")]
|
||||
|
|
@ -74,9 +75,10 @@ impl RedisConfig {
|
|||
|
||||
type Result<T, E = Error> = std::result::Result<T, E>;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
#[derive(Debug, Error, Diagnostic)]
|
||||
pub enum Error {
|
||||
#[error("{0:#}")]
|
||||
#[error(transparent)]
|
||||
#[diagnostic(transparent)]
|
||||
Php(PhpParseError),
|
||||
#[error("Provided config file doesn't seem to be a nextcloud config file: {0:#}")]
|
||||
NotAConfig(#[from] NotAConfigError),
|
||||
|
|
@ -90,8 +92,9 @@ pub enum Error {
|
|||
NoUrl,
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
#[derive(Debug, Error, Diagnostic)]
|
||||
#[error("Error while parsing '{path}':\n{err}")]
|
||||
#[diagnostic(forward(err))]
|
||||
pub struct PhpParseError {
|
||||
err: php_literal_parser::ParseError,
|
||||
path: PathBuf,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue