Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ You can find its changes [documented below](#070---2021-01-01).

### Fixed

- Fixed docs of derived Lens ([(#1523)] by [@Maan2003])

### Visual

### Docs
Expand Down Expand Up @@ -590,6 +592,7 @@ Last release without a changelog :(
[#1448]: https://github.com/linebender/druid/pull/1448
[#1463]: https://github.com/linebender/druid/pull/1463
[#1452]: https://github.com/linebender/druid/pull/1452
[#1523]: https://github.com/linebender/druid/pull/1523

[Unreleased]: https://github.com/linebender/druid/compare/v0.6.0...master
[0.6.0]: https://github.com/linebender/druid/compare/v0.5.0...v0.6.0
Expand Down
7 changes: 5 additions & 2 deletions druid-derive/src/lens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ fn derive_struct(input: &syn::DeriveInput) -> Result<proc_macro2::TokenStream, s
// Define lens types for each field
let defs = fields.iter().filter(|f| !f.attrs.ignore).map(|f| {
let field_name = &f.ident.unwrap_named();

let docs = format!(
"Lens for the field `{}` on [`{1}`](super::{1})",
field_name, ty
);
quote! {
/// Lens for the field on #ty
#[doc = #docs]
#[allow(non_camel_case_types)]
#[derive(Debug, Copy, Clone)]
pub struct #field_name;
Expand Down