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