mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-18 04:23:14 +02:00
Add missing mod declarations to modules solutions (#1601)
The solution for the modules exercise does not work since it is missing a a few module declarations. Here, we add them.
This commit is contained in:
parent
c0dfd54f2c
commit
26c088497f
@ -1,6 +1,6 @@
|
|||||||
# Solution
|
# Solution
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
// Copyright 2023 Google LLC
|
// Copyright 2023 Google LLC
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -18,6 +18,10 @@
|
|||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
// ---- src/widgets.rs ----
|
// ---- src/widgets.rs ----
|
||||||
|
mod button;
|
||||||
|
mod label;
|
||||||
|
mod window;
|
||||||
|
|
||||||
pub trait Widget {
|
pub trait Widget {
|
||||||
/// Natural width of `self`.
|
/// Natural width of `self`.
|
||||||
fn width(&self) -> usize;
|
fn width(&self) -> usize;
|
||||||
@ -172,6 +176,8 @@ impl Widget for Window {
|
|||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
// ---- src/main.rs ----
|
// ---- src/main.rs ----
|
||||||
|
mod widgets;
|
||||||
|
|
||||||
use widgets::Widget;
|
use widgets::Widget;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user