beads_rust_example_lib/lib.rs
1// Copyright 2026 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5pub fn add(a: i32, b: i32) -> i32 {
6 a + b
7}
8
9#[cfg(test)]
10mod tests {
11 use super::*;
12
13 #[test]
14 fn test_add() {
15 assert_eq!(add(2, 2), 4);
16 }
17}