Merge pull request #4884 from nyurik/impl-order

chore: Order trait impl same as trait
This commit is contained in:
Ed Page 2023-05-03 21:14:22 -05:00 committed by GitHub
commit 47c3b6f580
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,10 +28,10 @@ pub trait Generator {
/// pub struct Fish;
///
/// impl Generator for Fish {
/// # fn generate(&self, cmd: &Command, buf: &mut dyn Write) {}
/// fn file_name(&self, name: &str) -> String {
/// format!("{}.fish", name)
/// }
/// # fn generate(&self, cmd: &Command, buf: &mut dyn Write) {}
/// }
/// ```
fn file_name(&self, name: &str) -> String;
@ -55,12 +55,12 @@ pub trait Generator {
/// pub struct ClapDebug;
///
/// impl Generator for ClapDebug {
/// # fn file_name(&self, name: &str) -> String {
/// # name.into()
/// # }
/// fn generate(&self, cmd: &Command, buf: &mut dyn Write) {
/// write!(buf, "{}", cmd).unwrap();
/// }
/// # fn file_name(&self, name: &str) -> String {
/// # name.into()
/// # }
/// }
/// ```
fn generate(&self, cmd: &Command, buf: &mut dyn Write);