-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miette integration seems not to be completed and other understandable behaviors #32
Comments
I'm guessing the issue here concerns versioning and incompatible traits: version See also this comment on a related |
I knew this issue, but downgrade Miette doesn't fix the problem, you can check it by yourself. And these kind of problem on Miette integration has been kept once you remove the Miette dependency like that: [package]
name = "wax-proto"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
wax = { version = "0.5.0", features = ["diagnostics"] } With use wax::{Glob, GlobError};
fn main() -> Result<(), GlobError<'static>> {
Glob::new("**//*.txt")?;
Ok(())
} |
Hmm, that doesn't seem right. For what it's worth, I expect none of the example manifests you've shared so far to work properly with I have some working code that uses this integration, but I also created a minimal example just now and it works as expected. Are you sure you've taken an appropriate dependency specification on Here's a fairly minimal working manifest. [package]
name = "wax_issue_32"
version = "0.0.0"
edition = "2021"
[dependencies]
[dependencies.miette]
version = "^4.7.0"
features = ["fancy"]
[dependencies.wax]
version = "^0.5.0"
features = ["diagnostics"] I tested this with the following code and it prints diagnostics using use wax::Glob;
fn main() -> miette::Result<()> {
let _glob = Glob::new("**/{foo,**/bar}")?; // Error!
Ok(())
} |
Ok, thank you. Could i suggest to put this example in documention of Wax cause for an user of Wax like me how to use Miette is not clear and we must read the documentation of Miette in addition of Wax. Otherwise, you can close this issue if you want. |
Great, I'm glad it's working!
Yes, this sounds like a good idea. I can include some details regarding versions of integrated traits and how to determine what version specifications to use. I'll keep this issue open to track this. |
With Cargo file like this:
Note that, the Cargo file can be like this too, the problem will be the same:
With the file,
main.rs
:When we run the command
cargo run
:I found this result a little odd. With activated features in
Cargo.toml
, and https://github.com/olson-sean-k/wax/blob/master/src/lib.rs#L401, the response is understandable.And that, even if we add the
Diagnostic
trait:Plus, with that version of
main.rs
:We have this response:
We don't have the expected fancy printing from Miette.
We can notice that in the Cargo.toml of Wax, here: https://github.com/olson-sean-k/wax/blob/master/Cargo.toml#L42, the
fancy
feature is not activated. Is it normal ?To have a good use of the integration of Miette, there is something missing in our prototype project ?
The text was updated successfully, but these errors were encountered: