tests: Small refactor of doc tests (#396)

Move use NamedSource a bit up, since now it looks like it is not
imported.

Co-authored-by: Marat Fattakhov <m.fattakhov@yadro.com>
This commit is contained in:
Фаттахов Марат Русланович 2024-11-27 06:50:56 +03:00 committed by GitHub
parent 01564e070f
commit 68d47fa8b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@
//! //!
//! `thiserror` is a great way to define them, and plays nicely with `miette`! //! `thiserror` is a great way to define them, and plays nicely with `miette`!
//! */ //! */
//! use miette::{Diagnostic, SourceSpan}; //! use miette::{Diagnostic, NamedSource, SourceSpan};
//! use thiserror::Error; //! use thiserror::Error;
//! //!
//! #[derive(Error, Debug, Diagnostic)] //! #[derive(Error, Debug, Diagnostic)]
@ -127,7 +127,7 @@
//! throughout your app (but NOT your libraries! Those should always return //! throughout your app (but NOT your libraries! Those should always return
//! concrete types!). //! concrete types!).
//! */ //! */
//! use miette::{NamedSource, Result}; //! use miette::Result;
//! fn this_fails() -> Result<()> { //! fn this_fails() -> Result<()> {
//! // You can use plain strings as a `Source`, or anything that implements //! // You can use plain strings as a `Source`, or anything that implements
//! // the one-method `Source` trait. //! // the one-method `Source` trait.